What are accessor methods in java?



What are accessor methods in java?..

Answer / Rajesh Kumar

Accessor methods (also known as getter and setter methods) are used to access or modify the private fields of a class from other classes. They have the same name as the private field but they start with 'get' for getting and 'set' for setting.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is the size of int?

1 Answers  


Is java a super set of javascript?

1 Answers  


when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?

6 Answers  


Explain garbage collection in java?

1 Answers  


What access modifiers can be used for class ?

1 Answers  


what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread

1 Answers  


What is byte value?

1 Answers  


What are reference variables in java?

1 Answers  


What is the superclass of exception?

3 Answers  


Can you extend main method in java?

1 Answers  


Can we inherit inner class?

1 Answers  


What is a reflection package?

2 Answers  


Categories