Data Types and Variables 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); }} 25 2.5 3 2 0 25 2.5 3 2 0 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The following program:public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } } Prints true Will not compile as boolean can never be static Prints false Will not compile as boolean is not initialized Prints true Will not compile as boolean can never be static Prints false Will not compile as boolean is not initialized ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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._$); }} 7 9 0 None of these 7 0 0 Compile error - do is not valid identifier. Compile error - $7 is not valid identifier. 7 9 0 None of these 7 0 0 Compile error - do is not valid identifier. Compile error - $7 is not valid identifier. ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables 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 Rraises an error as STATIC is used as a variable which is a keyword Raises an exception None of these Prints 2.5 ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables In Java, the word true is ................ A Java keyword Same as value 1 Same as value 0 A Boolean literal A Java keyword Same as value 1 Same as value 0 A Boolean literal ANSWER DOWNLOAD EXAMIANS APP
Data Types and Variables The smallest integer type is ......... and its size is ......... bits. short, 16 byte, 8 short, 8 short, 16 short, 16 byte, 8 short, 8 short, 16 ANSWER DOWNLOAD EXAMIANS APP