Answer Posted / adarsh gowda
Getter and setter methods are used to retrieve and manipulate private variables in a different class. A "getter" method does as it name suggest, retrieves a the attribute of the same name. A setter method allows you to set the value of the attribute.
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the different types of functions?
What is generics in java interview questions?
What is the purpose of file class?
What is array initialization in java?
How many bytes is a url?
What do heavy weight components mean in java programming?
What are the restriction imposed on a static method or a static block of code?
How to implement an arraylist in java?
What is thread start?
What is the major advantage of external iteration over internal iteration?
Is a method a procedure?
What is the use of private static?
Which language is java?
Why is the main method declared static?
What is rule of accessibility in java?