1.
Which of the following method is used to obtain a single character from a String?
2.
Which of the following method can have the same name as that of it’s class?
3.
Which of the following class generates a dynamic array in Java?
4.
Which of the following methods is used to add an element in the beginning of a LinkedList?
5.
Which of the following Java object stores in the form of key value pairs?
6.
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");
}
}
}
7.
Which of the following keywords is used to raise exception manually in Java?
8.
What is the process called when child object gets destroyed due to the parent object?
9.
Which of the following is not a bitwise operator in Java?
10.
What is the process of defining multiple methods having same name but different parameters in a class?
11.
Which of the following are the access modifiers in Java?
12.
When does Java raises exceptions in the code?
13.
Which of the following keyword is used to inherit a class?
14.
Which of the following inheritance is not supported in Java?
15.
What is the number of primitive data types in java?
16.
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);
}
}
17.
What is the worst case time complexity of accessing an element in ArrayList?
18.
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();
}
}
19.
Which of the following features is not supported by Java?
20.
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);
}
}