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);} } None of these 10 50 Compilation Error TRUE ANSWER : ? YOUR ANSWER : ?
Size of int in Java is 32 bit 16 bit Depends on execution environment 64 bit TRUE ANSWER : ? YOUR ANSWER : ?
The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } } Prints false Will not compile as boolean can never be static Will not compile as boolean is not initialized Prints true TRUE ANSWER : ? YOUR ANSWER : ?
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 ) ; Does not compile as Integer and String are API class names. Throws exception. S 34 S 34 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); }} Compilation Error double float Exception is thrown at runtime TRUE ANSWER : ? YOUR ANSWER : ?
Java is a ........... language. moderate typed weakly typed None of these strongly typed TRUE ANSWER : ? YOUR ANSWER : ?
The smallest integer type is ......... and its size is ......... bits. short, 16 short, 16 byte, 8 short, 8 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following automatic type conversion will be possible? short to int int to long long to int byte to int TRUE ANSWER : ? YOUR ANSWER : ?
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. } Compilation fails with an error at line 4 14 21 Compilation fails with an error at line 6 14 13 None of these TRUE ANSWER : ? YOUR ANSWER : ?