What is the use of Getters and Setters method ?

Answer Posted / amol patil

That means you should use set<yourPropertyName> for methods
that can modify
a property (normally a property maps directly to an instance
variable, but not
necessarily) and get<yourPropertyName> for methods that can
read a property.
For example, a String variable name would have the following
getter/setter methods:

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you print array in java?

641


Can array grow dynamically in java?

605


What is ternary operator?

647


What are the parts of methodology?

637


How do you convert an int to a double in java?

682






How do you escape json?

656


What is output buffer?

657


How do you pass by reference?

627


What is static block?

673


What defines function?

632


What are encapsulation, inheritance and polymorphism?

615


How many boolean functions are there?

600


Which method must be implemented by all threads?

838


What are the types of sockets in java?

629


Why put method is used?

645