class Person {
public static int age = 10;
}
public class Application {
public static void main(String[] args) {
Person p = new Person();
p.age = 100;
System.out.println(Person.age);
Person.age = 22;
System.out.println(p.age);
}
}
I got 100 and 22 printed. Was I wrong in assuming that instances of a class cannot access/modify class/static variables.