The smallest integer type is ......... and its size is ......... bits. short, 16 byte, 8 short, 16 short, 8 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 2 25 2.5 3 TRUE ANSWER : ? YOUR ANSWER : ?
Size of int in Java is Depends on execution environment 64 bit 32 bit 16 bit TRUE ANSWER : ? YOUR ANSWER : ?
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. } Compilation fails with an error at line 8 Compilation fails with an error at line 5 17 None of these 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 Prints 2.5 None of these TRUE ANSWER : ? YOUR ANSWER : ?
In Java byte, short, int and long all of these are signed Both of the above None of these unsigned TRUE ANSWER : ? YOUR ANSWER : ?
In Java, the word true is ................ A Boolean literal Same as value 0 A Java keyword Same as value 1 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); }} float Exception is thrown at runtime double Compilation 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 true Prints false TRUE ANSWER : ? YOUR ANSWER : ?