CORE JAVA TEST 4 assesses knowledge in Java programming, focusing on class instance comparison, BitSet collections, Java Map interface, ArrayList features, Enumeration interface, and SortedSet usage. Key for learners enhancing Java skills.
A class that contains groups of unique sequences of bits.
A method for flipping individual bits in instance of a primitive type.
An array of boolean primitives that indicate zeros or ones.
A collection for storing bits as on-off information, like a vector of bits.
Rate this question:
A vector of arrays for a 2D geographic representation.
A class for containing unique array elements.
A class for containing unique vector elements.
An interface that ensures that implementing classes cannot contain duplicate keys.
Rate this question:
Java.util.HashSet
Java.util.LinkedHashSet
Java.util.List
Java.util.ArrayList
Java.util.Vector
Java.util.PriorityQueue
Rate this question:
True
False
Rate this question:
True
False
Rate this question:
True
False
Rate this question:
True
False
Rate this question:
A,B,C
B,C,A
Compilation fails
The code runs with no output
Exception is thrown at runtime
Rate this question:
True
False
Rate this question:
1 2 3
3 2 1
1 2 2
3 1 1
2 3 3
1 1 2
Rate this question:
3 false true 2
2 false true 3
3 true false 2
2 true false 3
Rate this question:
0
1
2
3
4
Compilation error
Exception is thrown at runtime
Rate this question:
Apple:apple
Carrot:apple
Apple:banana
Banana:apple
Carrot:carrot
Carrot:banana
Rate this question:
Set set = new TreeSet();
Set set = new HashSet();
Set set = new SortedSet();
Set set = new LinkedHashSet();
Set set = new SortedList();
Rate this question:
True
False
Rate this question:
An exception is thrown if you attempt to add an element with a duplicate value.
The add method returns false if you attempt to add an element with a duplicate value.
A set may contain elements that return duplicate values from a call to the equals method.
Duplicate values will cause an error at compile time.
Rate this question:
Compialtion fails
One two three four
Four one three two
One two three four one
One four three two one
An exception is thrown at runtime
The print order is not guaranteed
Rate this question:
Sort()
AsList()
ToList
Search()
SortList()
Contains()
BinarySearch()
Rate this question:
0
1
2
A
B
C
Result is undefined
Rate this question:
Collections. sort(a, a.reverse()); int result = Collections.binarySearch(a, “6”);
Comparator c = Collections.reverseOrder(); Collections.sort(a, c); int result = Collections.binarySearch(a, “6”);
Comparator c = Collections.reverseOrder(a); Collections.sort(a, c); int result = Collections.binarySearch(a, “6”,c);
Comparator c = new InverseComparator(new Comparator()); Collections.sort(a); int result = Collections.binarySearch(a, “6”,c);
Rate this question:
Public int hashCode()
Public boolean equals(Key k)
Public int compareTo(Object o)
Public boolean equals(Object o)
Public boolean compareTo(Key k)
Rate this question:
Compilation fails.
AAaA aAa AAaa AaA
AAaa AaA aAa aAaA
AaA AAaa aAaA aAa
aAa AaA aAaA AAaa
An exception is thrown at runtime.
Rate this question:
Collections.sort(x);
Comparable c=Collections.reverse(); Collections.sort(x,c);
Collections.sort(x,c);
Comparable c=Collections.reverseOrder(); Collections.sort(x,c);
Comparator c=Collections.reverseOrder(); Collections.sort(x,c);
Rate this question:
Compilation fails.
An exception is thrown at runtime.
"1.0" is printed.
"1" is printed.
Rate this question:
Compilation fails.
An exception is thrown at runtime.
"1.0" is printed.
"1" is printed.
Rate this question:
Compilation fails.
An exception is thrown at runtime.
"1.0" is printed.
"1" is printed.
Rate this question:
"three two one " is printed
"one two three " is printed
Nothing is printed
Compilation fails
An exception is thrown at runtime
Rate this question:
DoStuff1(list1);
DoStuff2(list2);
DoStuff2(list1);
DoStuff3(list1);
DoStuff3(list2);
DoStuff1(list2);
Rate this question:
0 through 4
0 through 5
-1 through 4
-1 through 5
-5 through 4
-5 through 5
-6 through 4
-6 through 5
Before () method will print 1 2
Before () method will print 1 2 3
Before () method wil print three numbers,but order cannot be determined.
Before () method will not compile
Before () method will throw an exception at runtime
Rate this question:
Two
None of the objects are eligible
Three
Four
One
Rate this question:
Abc
Runtime error
Compile error
HelloJavaWorld
HWJ
Rate this question:
Size: 64
Size: 44
Size: 66
Size: 46
Compilation error
Rate this question:
True
False
Rate this question:
Java.util.Queue
Java.util.ArrayList
Java.util.LinearList
Java.util.LinkedList
Rate this question:
SortedSet
TreeSet
ArrayList
List
Set
Rate this question:
HashSet
TreeSet
HashTable
LinkedHashSet
SortedSet
Rate this question:
Size:33
Size:36
Size:66
Compilation error
Size:66
Rate this question:
It provides static factory class
All major implementations like Hashtable, Vectors are supported
They provide hooks for custom implementations
All major interfaces are supported
Map is not supported
Rate this question:
Quiz Review Timeline (Updated): Sep 7, 2023 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.