21.
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();
      }
}

22.
Determine output:
public class Test{
      public static void main(String args[]){
            MyClass obj = new MyClass();
            obj.val = 1;
            obj.call(obj);
            System.out.println(obj.val);
      }
}

class MyClass{
      public int val;
      public void call(MyClass ref){
            ref.val++;
      }
}

23.
class MyClass{
	int i;
	int j;

	public MyClass(int i, int j){
		this.i = i;
		this.j = j;
	}

	public void call(){
		System.out.print("One");
	}
}

public class Test{
	public static void main(String args[]){
		MyClass m = new MyClass(); //line 1
		m.call(); //line 2
	}
}

24.
public class MyClass{ }
For the above class(MyClass) what is the correct way of declaring constructor?

25.
What is the output for the below code ?
1. public class A{
2.       int add(int i, int j){
3.             return i+j;
4.       }
5. }
6. public class B extends A{
7.       public static void main(String argv[]){
8.             short s = 9;
9.             System.out.println(add(s,6));
10.      }
11.}