DEVFYI - Developer Resource - FYI

If a variable is declared as private, where may the variable be accessed?

Java Interview Questions and Answers (part 2)


(Continued from previous question...)

246. If a variable is declared as private, where may the variable be accessed?

A private variable may only be accessed within the class in which it is declared.

(Continued on next question...)

Other Interview Questions