1. Java compiler translates source code
A. Machine Code
B. Assembly code
C. Byte code
D. Jvm code
Answer: C
2. Which of these interfaces is not part of Java's archive framework?
A list
B. Set
C. Sortdap
D. SortedList
Answer: D
3. What is the output of this program?
Import java.util. *;
Class output
{
public static void main (String [] args[])
{
Hashset obj = new HashSet ();
obj.add ('A');
obj.add ("B");
obj.add ('C');
System.out.println (obj + "" + obj.size ());
}
}
A. ABC 3
B. [A, B, C] 3
C. Abc 2
D. [A, B, C] 2
Answer: B
4 Which of these objects makes a relation between keys and values?
A. hash table
B. Map
C. Array
D. String
Answer: B
5. What is the output of this program?
Import java.util. *;
Class array {
public static void main (String [] args[]) {
int array [] = new int [5];
(int i = 5; i> 0; i--)
Array [5 - i] = i;
Arrays.sort (array);
System.out.print (Arrays.binarySearch (array, 4));
}
}
A. 2
B. 3
C. 4
D. 5
Answer: B
6. Which method is used to add an element to the beginning of a LinkedList object?
A. Add a ()
B. First ()
C. AddFirst ()
D. AddFirst ()
Answer: C
7. Which statement is correct for class java.util.hashSet?
A. The collection is guaranteed to be immutable.
B. The elements in the collection are unique.
C. Elements are ordered in the collection.
D. Elements in the collection are synchronized.
Answer: B
8. Which of these standard collection classes implement a dynamic array?
a. abstract
B Linklist
C. ArrayList
D. AbstractSet
Answer: C
9. Which of the following sets the class interface?
A. ArrayList
B. Hashset
C. Linkedlist
D. Dynamiclist
Answer: B
10. Which of the following packages stores all standard Java classes?
A. Lame
B. java
C. Use
D. Java.packages
Answer: B
A. Machine Code
B. Assembly code
C. Byte code
D. Jvm code
Answer: C
2. Which of these interfaces is not part of Java's archive framework?
A list
B. Set
C. Sortdap
D. SortedList
Answer: D
3. What is the output of this program?
Import java.util. *;
Class output
{
public static void main (String [] args[])
{
Hashset obj = new HashSet ();
obj.add ('A');
obj.add ("B");
obj.add ('C');
System.out.println (obj + "" + obj.size ());
}
}
A. ABC 3
B. [A, B, C] 3
C. Abc 2
D. [A, B, C] 2
Answer: B
4 Which of these objects makes a relation between keys and values?
A. hash table
B. Map
C. Array
D. String
Answer: B
5. What is the output of this program?
Import java.util. *;
Class array {
public static void main (String [] args[]) {
int array [] = new int [5];
(int i = 5; i> 0; i--)
Array [5 - i] = i;
Arrays.sort (array);
System.out.print (Arrays.binarySearch (array, 4));
}
}
A. 2
B. 3
C. 4
D. 5
Answer: B
6. Which method is used to add an element to the beginning of a LinkedList object?
A. Add a ()
B. First ()
C. AddFirst ()
D. AddFirst ()
Answer: C
7. Which statement is correct for class java.util.hashSet?
A. The collection is guaranteed to be immutable.
B. The elements in the collection are unique.
C. Elements are ordered in the collection.
D. Elements in the collection are synchronized.
Answer: B
8. Which of these standard collection classes implement a dynamic array?
a. abstract
B Linklist
C. ArrayList
D. AbstractSet
Answer: C
9. Which of the following sets the class interface?
A. ArrayList
B. Hashset
C. Linkedlist
D. Dynamiclist
Answer: B
10. Which of the following packages stores all standard Java classes?
A. Lame
B. java
C. Use
D. Java.packages
Answer: B