Question 1 of 25
Hints left: 3
Q1
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); } }
Q2
Which of this package is used for handling security related issues in a program?
Q3
Which of these methods returns the total number of bytes of memory available to the program?
Q4
What does System.getProperty("variable") return?
Q5
Which of the following constant are defined in Character wrapper?
Q6
Which of these is a super class of Character wrapper?
Q7
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); } }
Q8
Which of these is a wrapper for simple data type char?
Q9
Which of these packages contain all the Java's built in exceptions?
Q10
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)); } }
Q11
Which of this package is used for invoking a method remotely?
Q12
Which of these method returns a smallest whole number greater than or equal to variable X?
Q13
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()); } }
Q14
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); } }
Q15
Which of these package provides the ability to read and write in Zip format?
Q16
Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?
Q17
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(); } }
Q18
Which of function return absolute value of a variable?
Q19
Which of these methods of Byte wrapper can be used to obtain Byte object from a string?
Q20
Which of these exceptions handles the situations when an illegal argument is used to invoke a method?
Q21
Which of these class is used to create user defined exception?
Q22
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); } }
Q23
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(); } }
Q24
Which of these is a wrapper for simple data type float?
Q25
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); } }