here is some code plz observe it
1. class abc
3. static int a=10;
4. static abc ob=new abc();//static object instantiation
5. public static void main(String args)
9. public void method()
11. ob=new abc();// compiles and run
12. System.out.println(" a = "+a);// direct refence error
13. System.out.println(" a = "+ob.a);// with object still error
as java says that static members can't be refenced by non-static
methods. so why static objects as in line (10)are accessed by non-static method.as static variable is not at line (12,13),wheteher called directly or with the refence of object.
so i can't understand this behaviour of static.
can any body explain.
thanx in advance.