Question: 1.Given the following code fragment: int x=10; static int y=20; public void m11) System.out.println (x+y); public static void m2(){ System.out.println (x+y); } A. method m1
1.Given the following code fragment: int x=10; static int y=20; public void m11) System.out.println (x+y); public static void m2(){ System.out.println (x+y); \} A. method m1 can't access variable x B. method ml can't access variable y C. method m2 can't access variable x D. method m2 can't access variable y
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
