Java MCQ Quiz Hub

Java Mcq Question Set 6

Choose a topic to test your knowledge and improve your Java skills

Which of these class can generate an array which can increase and decrease in size automatically?





✅ Correct Answer: 3

Which of these method can be used to increase the capacity of ArrayList object manually?





✅ Correct Answer: 1

Which of these method of ArrayList class is used to obtain present size of an object?





✅ Correct Answer: 2

Which of these methods can be used to obtain a static array from an ArrayList object?





✅ Correct Answer: 1

Which of these standard collection classes implements a linked list data structure?





✅ Correct Answer: 1

Which of these method is used to add an element to the start of a LinkedList object?





✅ Correct Answer: 1

Which of these method of HashSet class is used to add elements to its object?





✅ Correct Answer: 2

Which of these methods can be used to delete the last element in a LinkedList object?





✅ Correct Answer: 4

Which of these object stores association between keys and values?





✅ Correct Answer: 1

Which of these method is used to reduce the capacity of an ArrayList object?





✅ Correct Answer: 2

Which of these classes provide implementation of map interface?





✅ Correct Answer: 2

Which of these method is used to remove all keys/values pair from the invoking map?





✅ Correct Answer: 1

Which of these method Map class is used to obtain an element in the map having specified key ?





✅ Correct Answer: 2

Which of these methods can be used to obtain set of all keys in a map?





✅ Correct Answer: 1

Which of these method is used add an element and corresponding key to a map?





✅ Correct Answer: 2

Which of these standard collection classes implements all the standard functions on list data structure?





✅ Correct Answer: 3

Which of these method is used to make all elements of an equal to specified value?





✅ Correct Answer: 1

Which of these method of Array class is used sort an array or its subset?





✅ Correct Answer: 4

Which of these methods can be used to search an element in a list?





✅ Correct Answer: 1

Which of these method is used to change an element in a LinkedList Object?





✅ Correct Answer: 3

Which of these standard collection classes implements all the standard functions on list data structure?





✅ Correct Answer: 4

Which of these classes implements Set interface?





✅ Correct Answer: 3

Which of these class object can be used to form a dynamic array?





✅ Correct Answer: 3

Which of these are legacy classes?





✅ Correct Answer: 4

All of the above





✅ Correct Answer: 2

What is the name of data member of class Vector which is used to store number of elements in the vector?





✅ Correct Answer: 2

Which of these methods is used to add elements in vector at specific location?





✅ Correct Answer: 1

Which of these class object uses key to store value?





✅ Correct Answer: 4

Which of these method is used to insert value and its key?





✅ Correct Answer: 2

Which of these is the interface of legacy is implemented by Hashtable and Dictionary classes?





✅ Correct Answer: 1

Which of these is a class which uses String as a key to store the value in object?





✅ Correct Answer: 2

Which of these methods is used to retrieve the elements in properties object at specific location?





✅ Correct Answer: 2

Which of these class object has architecture similar to that of array?





✅ Correct Answer: 2

Which of these method is used to make a bit zero specified by the index?





✅ Correct Answer: 1

Which of these method is used to calculate number of bits required to hold the BitSet object?





✅ Correct Answer: 3

Which of these is a method of class Date which is used to search weather object contains a date before the specified date?





✅ Correct Answer: 4

Which of these methods is used to retrieve elements in BitSet object at specific location?





✅ Correct Answer: 1

Which of these is a process of writing the state of an object to a byte stream?





✅ Correct Answer: 2

Which of these process occur automatically by java run time system?





✅ Correct Answer: 2

Which of these interface extends DataOutput interface?





✅ Correct Answer: 4

Which of these is a method of ObjectOutput interface used to finalize the output state so that any buffers are cleared?





✅ Correct Answer: 1

Which of these is method of ObjectOutput interface used to write the object to input or output stream as required?





✅ Correct Answer: 2

Which of these is a process of extracting/removing the state of an object from a stream?





✅ Correct Answer: 2

Which of these process occur automatically by java run time system?





✅ Correct Answer: 4

Which of these is an interface for control over serialization and deserialization?





✅ Correct Answer: 1

Which of these interface extends DataInput interface?





✅ Correct Answer: 2

Which of these is a method of ObjectInput interface used to deserialize an object from a stream?





✅ Correct Answer: 3

Which of these class extend InputStream class?





✅ Correct Answer: 1

Which of these method can be used to make the main thread to be executed last among all the threads?





✅ Correct Answer: 3

Which of these method is used to find out that a thread is still running or not?





✅ Correct Answer: 4