Question 1 of 25
Hints left: 3
Q1
Which of these is an correct way of defining generic class?
Q2
What will be the output of the following Java program? class Output { public static void main(String args[]) { double x = 3.1; double y = 4.5; double z = Math.max( x, y ); System.out.print(z); } }
Q3
What will be the output of the following Java code? class Output { public static void main(String args[]) { Double i = new Double(257.578123456789); float x = i.floatValue(); System.out.print(x); } }
Q4
Which of the following methods Byte wrapper return the value as a double?
Q5
Which of the following is the correct way of implementing an interface A by class B?
Q6
What will be the output of the following Java program? import java.lang.reflect.*; class Additional_packages { public static void main(String args[]) { try { Class c = Class.forName("java.awt.Dimension"); Field fields[] = c.getFields(); for (int i = 0; i < fields.length; i++) System.out.println(fields[i]); } catch (Exception e) { System.out.print("Exception"); } } }
Q7
Which environment variable is used to set java path?
Q8
Which of these access specifiers can be used for a class so that its members can be accessed by a different class in the different package?
Q9
Which of the following methods return the value as a double?
Q10
What is the return type of Math.random() method?
Q11
Which of these class provides various types of rounding functions?
Q12
Which of these class contains all the methods present in Math class?
Q13
Which system property stores installation directory of JRE?
Q14
What will be the output of the following Java program? class exception_handling { static void throwexception() throws ArithmeticException { System.out.print("0"); throw new ArithmeticException ("Exception"); } public static void main(String args[]) { try { throwexception(); } catch (ArithmeticException e) { System.out.println("A"); } } }
Q15
What is the use of Observable class?
Q16
Where is String Pool stored?
Q17
What is the value of "d" in the following Java code snippet? double d = Math.round ( 2.5 + Math.random() );
Q18
Which of these coding techniques is used by method isDefined()?
Q19
Which of the following is true about Java system properties?
Q20
What will happen if we provide concrete implementation of method in interface?
Q21
Which of these methods of Boolean wrapper returns boolean equivalent of an object.
Q22
Which of these keywords is used by a class to use an interface defined previously?
Q23
What will be the output of the following Java program? import java.lang.System; class Output { public static void main(String args[]) { byte a[] = { 65, 66, 67, 68, 69, 70 }; byte b[] = { 71, 72, 73, 74, 75, 76 }; System.arraycopy(a, 0, b, 0, a.length); System.out.print(new String(a) + " " + new String(b)); } }
Q24
Which of these can be used to fully abstract a class from its implementation?
Q25
Classes and Methods are stored in which space?