In Java byte, short, int and long all of these are signed Both of the above unsigned None of these TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following automatic type conversion will be possible? byte to int long to int short to int int to long TRUE ANSWER : ? YOUR ANSWER : ?
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); }} 129 2 Compiler error -127 None of these TRUE ANSWER : ? YOUR ANSWER : ?
In Java, the word true is ................ A Boolean literal A Java keyword Same as value 0 Same as value 1 TRUE ANSWER : ? YOUR ANSWER : ?
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. } 0 None of these 128 Compilation fails with an error at line 3 Compilation fails with an error at line 4 TRUE ANSWER : ? YOUR ANSWER : ?
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. } None of these Compilation fails with an error at line 5 10 7 8 7 Compilation fails with an error at line 3 TRUE ANSWER : ? YOUR ANSWER : ?
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(); }} 0 false 0 None of these Compile error - static variable must be initialized before use. 0 true 0 0 0 0 TRUE ANSWER : ? YOUR ANSWER : ?
The following fraction of codedouble STATIC = 2.5 ;System.out.println( STATIC ); Rraises an error as STATIC is used as a variable which is a keyword Raises an exception None of these Prints 2.5 TRUE ANSWER : ? YOUR ANSWER : ?
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 ) ; }} 22 20 Compilation Error Throws Exception 21 TRUE ANSWER : ? YOUR ANSWER : ?