A
Q. What is the output of the program?
class MyClass{
MyClass(){
System.out.print("one");
}
public void myMethod(){
this();
System.out.print("two");
}
}
public class TestClass{
public static void main(String args[]){
MyClass obj = new MyClass();
obj.myMethod();
}
}
- Correct Answer - Option(D)
- Views: 15
- Filed under category Java
- Hashtags:
Discusssion
Login to discuss.