Question 1 of 25
Hints left: 3
Q1
What is the default value of a boolean array element in Java if it's not explicitly initialized?
Q2
Size of int in Java is
Q3
What is the output of the following program? class A{ public static void main(String args[]){ byte b; int i = 258; double d = 325.59; b = (byte) i; System.out.print(b); i = (int) d; System.out.print(i); b = (byte) d; System.out.print(b); } }
Q4
Which of the following is the correct way to declare a byte variable named myByte and initialize it to 5 in Java?
Q5
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 ) ; } }
Q6
In Java, the word true is ................
Q7
Which of the following is not a valid way to declare a char variable in Java?
Q8
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 ) ;
Q9
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); } }
Q10
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); } }
Q11
The following program: public class Test{ static boolean isOK; public static void main(String args[]){ System.out.print(isOK); } }
Q12
In Java byte, short, int and long all of these are
Q13
How many primitive data types are there in Java?
Q14
Which data type is used to store numbers with decimal points and less precision than double?
Q15
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); } }
Q16
The smallest integer type is ......... and its size is ......... bits.
Q17
What is the range of values that can be stored in a char variable in Java?
Q18
Automatic type conversion in Java takes place when
Q19
Java is a ........... language.
Q20
What is the output for the below code? class A{ int k; boolean istrue; static int p; public void printValue(){ System.out.print(k); System.out.print(istrue); System.out.print(p); } } public class Test{ public static void main(String argv[]){ A a = new A(); a.printValue(); } }
Q21
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); } }
Q22
Which of the following automatic type conversion will be possible?
Q23
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); } }
Q24
Size of float and double in Java is
Q25
The following fraction of code double STATIC = 2.5 ; System.out.println( STATIC );