Private Helper Methods in a Java Class - Private vs. Public Method Example - APPFICIAL

preview_player
Показать описание
A programmer may sometimes create private helper methods to assist public methods in carrying out their tasks. For example, if a class called Car has a method called accelerate(), you know that calling the method makes the car go faster. However, you don’t need to know what is going on under the hood. All the mechanical parts of the car are hidden in a private helper method.

SUBSCRIBE
Рекомендации по теме
Комментарии
Автор

Please SUBSCRIBE! More programming videos coming soon! ✌️

Appficial
Автор

Great examples and explanations! Thanks!

Martin-xxkw
Автор

why the weight comes after the message "digesting his food" while in the public method the variable weight is before the message "digesting.... " ????

rrm
Автор

I still don't get the actual use, is this to save space in app?

loveworksnoevil
Автор

The helper method naming convention is *originalMethodNameHelper*

thatoneuser
Автор

lol the example. "bob ate so he became fat" but why can't i make digestFood() public - like what is the benefit? Can I not use it then within the public class of Person?

iamseebabhatia
welcome to shbcf.ru