I think Non-static function can use static variables defined at the class level but static functions can't use non-static variables defined at class level. Is this correct? Thanks a lot
It is possible to call a non-static function from a static function if you are using a reference object. for example public class Test{ public static void main(String args[]) { Test testRef = new Test(); testRef.func(); //will work //func(); //does not work } public void func() { System.out.println("in func"); } }//end of class Test
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees: