Progate java course IV and IV dojo. Study time is about 3 hours. I understand that when creating an instance, I use a constructor to enter arguments. private can be used only for that class, and public can be used for other classes. In the case of private, if you want to output the value assigned at the time of instance creation, use the getter method to output. The value can be changed with the setter method. Using private and restricting its use is called encapsulation.
Recommended Posts