1.

All the variables of class should be ideally declared as?(a) private(b) public(c) protected(d) defaultI had been asked this question by my school teacher while I was bunking the class.My question is from Access Control in division Classes and Methods of Java

Answer»

Correct ANSWER is (a) PRIVATE

The explanation: The variables should be private and should be accessed with GET and set METHODS.



Discussion

No Comment Found

Related InterviewSolutions