Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Java program? class Output { public static void main(String args[]) { Long i = new Long(256); System.out.print(i.hashCode()); } }
Q2
What will be the output of the following Java code? class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.ceil(x); System.out.print(y); } }
Q3
What will be the output of the following Java code? 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)); } }
Q4
Which of this package is used for invoking a method remotely?
Q5
What will be the output of the following Java code? class A { int x; int y; void display() { System.out.print(x + " " + y); } } class Output { public static void main(String args[]) { A obj1 = new A(); A obj2 = new A(); obj1.x = 1; obj1.y = 2; obj2 = obj1.clone(); obj1.display(); obj2.display(); } }
Q6
Which of these is a wrapper for simple data type float?
Q7
Which of these is a super class of Character wrapper?
Q8
What will be the output of the following Java program? class newthread implements Runnable { Thread t; newthread() { t = new Thread(this,"New Thread"); t.start(); } public void run() { t.setPriority(Thread.MAX_PRIORITY); System.out.println(t); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } }
Q9
Which of these methods of Byte wrapper can be used to obtain Byte object from a string?
Q10
Which of this package is used for handling security related issues in a program?
Q11
Which of the following constant are defined in Character wrapper?
Q12
Which of these exceptions handles the situations when an illegal argument is used to invoke a method?
Q13
Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?
Q14
Which of these package provides the ability to read and write in Zip format?
Q15
Which of function return absolute value of a variable?
Q16
What will be the output of the following Java code? class Output { public static void main(String args[]) { double x = 3.14; int y = (int) Math.abs(x); System.out.print(y); } }
Q17
Which of these class is used to create user defined exception?
Q18
Which of these method returns a smallest whole number greater than or equal to variable X?
Q19
What does System.getProperty("variable") return?
Q20
What will be the output of the following Java program? class Output { public static void main(String args[]) { double x = 2.0; double y = 3.0; double z = Math.pow( x, y ); System.out.print(z); } }
Q21
What will be the output of the following Java code? class Output { public static void main(String args[]) { Double i = new Double(257.578); int x = i.intValue(); System.out.print(x); } }
Q22
Which of these is a wrapper for simple data type char?
Q23
Which of these methods returns the total number of bytes of memory available to the program?
Q24
Which of these packages contain all the Java's built in exceptions?
Q25
What will be the output of the following Java program? package pkg; class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); s1.setCharAt(1, x); System.out.println(s1); } }