1.
What is the process of defining multiple methods having same name but different parameters in a class?
2.
Which of the following methods is used to add an element in the beginning of a LinkedList?
3.
When does Java raises exceptions in the code?
4.
What is the worst case time complexity of accessing an element in ArrayList?
5.
What will be the output of the following Java code?
class edSlash
{
public static void main(String args[])
{
try
{
int m, n;
n = 0;
m = 5 / n;
System.out.print("Java");
}
catch(ArithmeticException e)
{
System.out.print("edSlash");
}
}
}
6.
Which of the following is not a bitwise operator in Java?
7.
Which of the following keyword is used to inherit a class?
8.
Which of the following are the access modifiers in Java?
9.
Which of the following method is used to obtain a single character from a String?
10.
Which of the following features is not supported by Java?
11.
What is the number of primitive data types in java?
12.
Which of the following class generates a dynamic array in Java?
13.
What will be the output of the following Java code?
import java.util.*;
class edSlash
{
public static void main(String args[])
{
ArrayList obj = new ArrayList();
obj.add("Rahul");
obj.add("Rajat");
obj.add("Rakesh");
obj.add(0, "Rajiv");
System.out.println(obj);
}
}
14.
What will be the output of following Java code?
class edSlash
{
public static void main(String args[])
{
int a;
a = 10;
{
int b = 20;
System.out.print(a + b);
}
System.out.println(a + b);
}
}
15.
Which of the following Java object stores in the form of key value pairs?
16.
What will be the output of the following Java code?
class Car
{
void display()
{
System.out.println(“This is a Car”);
}
}
class Jeep extends Car
{
void display()
{
System.out.println(“This is a Jeep”);
}
}
class edSlash
{
public static void main(String args[])
{
Jeep obj=new Jeep();
obj.display();
}
}
17.
Which of the following method can have the same name as that of it’s class?
18.
What is the process called when child object gets destroyed due to the parent object?
19.
Which of the following inheritance is not supported in Java?
20.
Which of the following keywords is used to raise exception manually in Java?