41. 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);
}
}
package pkg;
class output
{
public static void main(String args[])
{
StringBuffer s1 = new StringBuffer("Hello");
s1.setCharAt(1, x);
System.out.println(s1);
}
}
42. Which of these exceptions handles the situations when an illegal argument is used to invoke a method?
43. 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);
}
}
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);
}
}
44. Which of the following constant are defined in Character wrapper?
45. What will happen if we provide concrete implementation of method in interface?
46. Which of these class provides various types of rounding functions?
47. 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));
}
}
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));
}
}
48. Which environment variable is used to set java path?
49. Which system property stores installation directory of JRE?
50. Which of these coding techniques is used by method isDefined()?
Read More Section(Interfaces and Abstract Classes)
Each Section contains maximum 100 MCQs question on Interfaces and Abstract Classes. To get more questions visit other sections.