A
Q. What will be the output after compiling and running following program code?
Code:
public class Test{
static int a;
public static void main(String[] args){
System.out.println("one");
call(1);
}
static void call(int a){
this.a=10;
System.out.println("two "+a);
}
}
static int a;
public static void main(String[] args){
System.out.println("one");
call(1);
}
static void call(int a){
this.a=10;
System.out.println("two "+a);
}
}
- Correct Answer - Option(D)
- Views: 10
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.