1.
What is @Override annotation?
2.
Which of the following statements is true?
4.
What is the command to run a JAR file application?
6.
There is a class with private constructors only. How can we provide a way to create instance of this class?
7.
What happens when we try to add the same element twice to a Set?
9.
In the following code. Who has access to member num?
package car;
public class Audi {
int num;
}
13.
What is the difference between Vector and ArrayList?
14.
What is the output for the below code?
public class Test{
public static void main(String[] args){
Integer i = Integer.valueOf("1");
if(i.toString()=="1")
System.out.println("Equal");
else
System.out.println("Not Equal");
}
}
15.
When is an object's finalize method called?
18.
What is the output of the following class?
public class Test{
public Test() {
int x = 5;
return x;
}
public static void main(String[] args){
System.out.println(new Test());
}
}
19.
Which Java declaration will return syntax error?
20.
Which of the following declaration is correct?