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 None of these -127 Compiler error TRUE ANSWER : ? YOUR ANSWER : ?
The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } } Will not compile as boolean is not initialized Will not compile as boolean can never be static Prints false Prints true TRUE ANSWER : ? YOUR ANSWER : ?
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); }} 10 20 10 10 10 20 10 100 10 20 10 20 Error TRUE ANSWER : ? YOUR ANSWER : ?
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); }} 0 25 2 2.5 3 TRUE ANSWER : ? YOUR ANSWER : ?
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); }} Exception is thrown at runtime double Compilation Error float TRUE ANSWER : ? YOUR ANSWER : ?
Java is a ........... language. moderate typed None of these strongly typed weakly typed TRUE ANSWER : ? YOUR ANSWER : ?
Size of float and double in Java is 64 and 32 32 and 32 32 and 64 64 and 64 TRUE ANSWER : ? YOUR ANSWER : ?
In Java, the word true is ................ A Java keyword Same as value 1 A Boolean literal Same as value 0 TRUE ANSWER : ? YOUR ANSWER : ?
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);}} 65 34 34 65 34 34 65 65 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. } Compilation fails with an error at line 4 128 0 Compilation fails with an error at line 3 None of these TRUE ANSWER : ? YOUR ANSWER : ?