Hi all, 
        I have a small doubt regarding JDK1.2.
        Here is a small piece of code that i compiled using both
        jdk1.1.6 and jdk 1.2. In jdk1.1.6 it compiles peacefully but
        does not compile using JDK1.2. The error it gives is :-

        var.java:13: Can't make a static reference to nonstatic variable
        x in class B.
                float bx=B.x;
                          ^
        var.java:14: Can't make a static reference to nonstatic variable x in
        class A.
                Object ax=A.x;
                           ^

        
        The code is:
        ------------

        class A {
            Object x;
        }

        class B extends A {
            float x;
        }       
        class var extends B {
            char x;
            void m() {
                char cx=x;
                float bx=B.x;
                Object ax=A.x;
           }
        }       

Note this example is taken straight from the Java Language specification
book-1.0. Please can somebody help me in clearing my doubt ... 

regards,
Raj

PS: Please do not send a group mail, u can send me a mail to this
address: [EMAIL PROTECTED] Thanx to them who replied to my previous
mail. Thanx a lot...


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to