What happens to the rules of access modifiers when using objects in java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What happens to the rules of access modifiers when using objects in java?

What is the behavior of objects under access modifiers

11th Jul 2018, 2:30 AM
Hrushikesh Tiwari
Hrushikesh Tiwari - avatar
1 Answer
0
I think your question is not clear enough but as I understand your question, my answer is for example as usual we use access modifiers for fields, classes, methods or constructor but for ex when we use access modifiers for fields it hides states of object ( private access modifier) and you should use getter & setter to change that fields ( or change the state of object)
11th Jul 2018, 8:22 PM
Mohammadyar Barandov
Mohammadyar Barandov - avatar