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

What are design patterns and please explain?

566


Can we create more than one object singleton class?

572


What is floor in java?

552


What is multiple inheritance? Is it supported by java?

519


What is busy spin, and why should you use it?

586






What is the full form of jpeg?

511


What does pointer mean?

539


Which list is sorted in java?

578


Which oo concept is achieved by using overloading and overriding?

531


What is java and their uses?

544


Why declare Main() method as a static in java ?

593


Outline the major features of java.

561


What is diamond operator in java?

493


What is independent and dependent variables in research?

466


What are multiple inheritances?

576