Related questions
Why can outer Java classes access inner class private members?
I observed that Outer classes can access inner classes private instance variables. How is this possible? Here is a sample code demonstrating the same:
class ABC{
class XYZ{
private int x=10;
}
public static void main(String... args){
ABC.XYZ xx = …
Advantage of set and get methods vs public variable
Possible Duplicate:
Why use getters and setters?
Is there any advantage to making methods to access private variables in your class instead of making the variable public?
For example is the second case better than the first?
//Case 1
public class …