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);}} 34 65 34 34 65 34 65 65 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 Exception is thrown at runtime float double TRUE ANSWER : ? YOUR ANSWER : ?
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);} } Compilation Error 50 None of these 10 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 Throws Exception Compilation Error 21 TRUE ANSWER : ? YOUR ANSWER : ?
In Java, the word true is ................ A Boolean literal Same as value 1 Same as value 0 A Java keyword 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 ) ; Throws exception. Does not compile as Integer and String are API class names. S 34 S 34 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); }} 2.5 25 3 2 0 TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:public class Test{ int a = 10; public void method(int a){ a += 1; System.out.println(++a); } public static void main(String args[]){ Test t = new Test(); t.method(3); }} 11 5 12 4 None of these TRUE ANSWER : ? YOUR ANSWER : ?
Java is a ........... language. moderate typed strongly typed None of these weakly typed 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 5 17 0 Compilation fails with an error at line 8 None of these TRUE ANSWER : ? YOUR ANSWER : ?