Hello Friends, I can't understand the philosphy of Marcus(Infact JVM) for the following question.
Ans: Compile time error Explanation: You will get an error saying something like "Cant make a static reference to a non static variable". Note that the main method is static. Even if main was not static the array argv is local to the main method and would thus not be visible within amethod. Regards, Hassan.
Always Belive On Logic!!
Joined: Jun 25, 2001
Hassan, What is that you did not understand here?As the explaination goes,argv is of course local to the main method and amethod can access MyArg but not argv.Also since MyArg is non static,you cannot access it directly without creating an instance of the class Arg. Rashmi