61. What is true of final class?
62. Which of these cannot be declared static?
63. What will be the output of the following Java snippet, if compiled and executed with command line "hello there"?
public class abc
{
String[] xyz;
public static void main(String argv[])
{
xyz=argv;
}
public void runMethod()
{
System.out.println(argv[1]);
}
}
public class abc
{
String[] xyz;
public static void main(String argv[])
{
xyz=argv;
}
public void runMethod()
{
System.out.println(argv[1]);
}
}
64. How many copies of static and class variables are created when 10 objects are created of a class?
65. Which of the following statements are incorrect?
66. Can a class be declared with a protected modifier.
67. What will be the output of the following Java code snippet running with "java demo I write java code"?
public class demo
{
public static void main(String args[])
{
System.out.println(args[0]+""+args[args.length-1]);
}
}
public class demo
{
public static void main(String args[])
{
System.out.println(args[0]+""+args[args.length-1]);
}
}
68. What will be the output of the following Java program?
class equality
{
int x;
int y;
boolean isequal()
{
return(x == y);
}
}
class Output
{
public static void main(String args[])
{
equality obj = new equality();
obj.x = 5;
obj.y = 5;
System.out.println(obj.isequal);
}
}
class equality
{
int x;
int y;
boolean isequal()
{
return(x == y);
}
}
class Output
{
public static void main(String args[])
{
equality obj = new equality();
obj.x = 5;
obj.y = 5;
System.out.println(obj.isequal);
}
}
69. What happens if constructor of class A is made private?
70. Which of the following modifier means a particular variable cannot be accessed within the package?
Read More Section(Miscellaneous in Java)
Each Section contains maximum 100 MCQs question on Miscellaneous in Java. To get more questions visit other sections.