Q.1
What is the output for the below code ?
1. public class Test{
2.       public static void main(String[] args){
3.             int i = 010;
4.             int j = 07;
5.             System.out.println(i);
6.             System.out.println(j);
7.       }
8. }
Q.2
What will be output of following program?
public class Test{
      public static void main(String[] args){
            byte b=127;
            b++;
            b++;
            System.out.println(b);
      }
}
Q.3
What is the output for the below code?
public class Test{
      int _$;
      int $7;
      int do;

      public static void main(String argv[]){
            Test test = new Test();
            test.$7=7;
            test.do=9;
            System.out.println(test.$7);
            System.out.println(test.do);
            System.out.println(test._$);
      }
}
Q.4
Determine output:
public class Test{
      int a = 10;
    
      public void method(int a){
            a += 1;
            System.out.println(++a);
      }
      public static void main(String args[]){
            Test t = new Test();
            t.method(3);
      }
}
Q.5
What is the output for the below code ?
1. public class Test{
2.       public static void main(String[] args){
3.             byte b = 6;
4.             b+=8;
5.             System.out.println(b);
6.             b = b+7;
7.             System.out.println(b);
8.       }
9. }
Q.6
Determine output:
public class Test{
	int i = 34;
	public static void main(String args[]){
		Test t1 = new Test();
		Test t2 = new Test();
		t1.i = 65;
		System.out.print(t1.i);
		System.out.print(t2.i);
	}
}
Q.7
The following program:
public class Test{ 
        static boolean isOK;
        public static void main(String args[]){
                System.out.print(isOK);
        } 
}
Q.8
What will be the output for the below code ?
1. public class Test{
2.       public static void main(String[] args){
3.             byte i = 128;
4.             System.out.println(i);
5.       }
6. }
Q.9
What will be the output for the below code ?
1. public class Test{
2.       int i=8;
3.       int j=9;
4.       public static void main(String[] args){
5.             add();
6.       }
7.       public static void add(){
8.             int k = i+j;
9.             System.out.println(k);
10.      }
11. }
Q.10
Determine output:
public class Test {
        static void test(float x){
                System.out.print("float");
        }

        static void test(double x){
                System.out.print("double");
        }

        public static void main(String[] args){
                test(99.9);
        }
}
Q.11
The following fraction of code
double STATIC = 2.5 ;
System.out.println( STATIC );
Q.12
In Java, the word true is ................
Q.13
What will the output of the following program?
public class Test{
      public static void main(String args[]){
            float f = (1 / 4) * 10;
            int i = Math.round(f);
            System.out.println(i);
      }
}
Q.14
What would be the output of the following fraction of code ?
int Integer = 34 ;
char String = 'S' ;
System.out.print( Integer ) ;
System.out.print( String ) ;
Q.15
What is the output of the following program?
public class Test{
	static int x  = 10 ;
       	public static void main(String[] a){
		 Test test = new Test( ) ; 
		 Test test1 = new Test( ) ;
		 test.x  +=  1 ;
		 System.out.println(  test.x + test1.x ) ;    
	}
}
Q.16
What is the output for the below code ?
class A{
      int k;
      boolean istrue;
      static int p;
      public void printValue(){
            System.out.print(k);
            System.out.print(istrue);
            System.out.print(p);
      }
}

public class Test{
      public static void main(String argv[]){
            A a = new A();
            a.printValue();
      }
}
Q.17
Size of float and double in Java is
Q.18
What will be output of the following program code?
public class Test{
	public static void main(String[] a){
		short x = 10;
		x = x*5;
		System.out.print(x);
	}  
}
Q.19
Determine output:
class A{
        public static void main(String args[]){
	        int x;
 	        x = 10;
	        if(x == 10){
		        int y = 20;
		        System.out.print("x and y: "+ x + " " + y);
		        y = x*2;
	        }
	        y = 100;
	        System.out.print("x and y: " + x + " " + y);
        }
}
Q.20
Automatic type conversion in Java takes place when
0 h : 0 m : 1 s