Java/Java Mcq Question Set 6 Sample Test,Sample questions

Question:
 Which of these are legacy classes?

1.Vector

2.Hashtable

3.Stack

4.All of the above

Posted Date:-2021-10-25 05:30:00


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

1.Object WriteObject()

2.void close()

3.Object readObject()

4.int read()

Posted Date:-2021-10-25 05:30:00


Question:
All of the above

1.HashMap

2.Enumeration

3.Hashtable

4.Map

Posted Date:-2021-10-25 05:30:00


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

1.elements

2.elementCount

3.length

4.capacity

Posted Date:-2021-10-25 05:30:00


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

1.DynamicsList()

2.DynamicList()

3.ArrayList()

4.LinkedList()

Posted Date:-2021-10-25 05:30:00


Question:
Which of these class extend InputStream class?

1.ObjectInputStream

2.ObjectStream

3.ObjectInput

4.ObjectOutput

Posted Date:-2021-10-25 05:30:00


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

1.ArrayList

2.Map

3.Both a & b

4.Vector

Posted Date:-2021-10-25 05:30:00


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

1.Hashtable

2.Bitset

3.Map

4.All of the above

Posted Date:-2021-10-25 05:30:00


Question:
Which of these class object uses key to store value?

1.Dictionary

2.Map

3.Hashtable

4.All of the above

Posted Date:-2021-10-25 05:30:00


Question:
Which of these classes implements Set interface?

1.LinkedList

2.DynamicList

3.HashSet

4.ArrayList

Posted Date:-2021-10-25 05:30:00


Question:
Which of these classes provide implementation of map interface?

1.LinkedList

2.HashMap

3.ArrayList

4.DynamicList

Posted Date:-2021-10-25 05:30:00


Question:
Which of these interface extends DataInput interface?

1.Serializable

2.ObjectInput

3.Externalization

4.ObjectOutput

Posted Date:-2021-10-25 05:30:00


Question:
Which of these interface extends DataOutput interface?

1.Externalization

2.Serializable

3.ObjectInput

4.ObjectOutput

Posted Date:-2021-10-25 05:30:00


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

1.ArrayList

2.Properties

3.Dictionary

4.Array

Posted Date:-2021-10-25 05:30:00


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

1.contains()

2.after()

3.compareTo()

4.before()

Posted Date:-2021-10-25 05:30:00


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

1.flush()

2.close()

3.fflush()

4.clear()

Posted Date:-2021-10-25 05:30:00


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

1.Externalization

2.Deserialization

3.Serialization

4.File Filtering

Posted Date:-2021-10-25 05:30:00


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

1.Externalization

2.Serialization

3.File Filtering

4.All of the above

Posted Date:-2021-10-25 05:30:00


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

1.Externalization

2.Serializable

3.FileFilter

4.ObjectInput

Posted Date:-2021-10-25 05:30:00


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

1.StreamWrite()

2.writeObject()

3.Write()

4.write()

Posted Date:-2021-10-25 05:30:00


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

1.Map

2.HashMap

3.Hashtable

4.Enumeration

Posted Date:-2021-10-25 05:30:00


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

1.ensureCapacity()

2.increasecapacity()

3.increaseCapacity()

4.Capacity()

Posted Date:-2021-10-25 05:30:00


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

1.join()

2.stop()

3.sleep()

4.call()

Posted Date:-2021-10-25 05:30:00


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

1.set()

2.put()

3.add()

4.redo()

Posted Date:-2021-10-25 05:30:00


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

1.addFirst()

2.AddFirst()

3.first()

4.add()

Posted Date:-2021-10-25 05:30:00


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

1.numberofBits()

2.indexes()

3.length()

4.size()

Posted Date:-2021-10-25 05:30:00


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

1.add()

2.change()

3.redo()

4.set()

Posted Date:-2021-10-25 05:30:00


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

1.Alive()

2.checkRun()

3.run()

4.isAlive()

Posted Date:-2021-10-25 05:30:00


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

1.set()

2.put()

3.addElement()

4.insertElement()

Posted Date:-2021-10-25 05:30:00


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

1.clear()

2.put()

3.set()

4.remove()

Posted Date:-2021-10-25 05:30:00


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

1.fill()

2.add()

3.set()

4.all()

Posted Date:-2021-10-25 05:30:00


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

1.trimTosize()

2.trimToSize()

3.trimSize()

4.trim()

Posted Date:-2021-10-25 05:30:00


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

1.remove()

2.delete()

3.removeAll()

4.clear()

Posted Date:-2021-10-25 05:30:00


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

1.get()

2.search()

3.look()

4.set()

Posted Date:-2021-10-25 05:30:00


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

1.bubblesort()

2.binarysort()

3.insert()

4.sort()

Posted Date:-2021-10-25 05:30:00


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

1.index()

2.size()

3.capacity()

4.length()

Posted Date:-2021-10-25 05:30:00


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

1.Add()

2.add()

3.insert()

4.addFirst()

Posted Date:-2021-10-25 05:30:00


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

1.delete()

2.remove()

3.deleteLast()

4.removeLast()

Posted Date:-2021-10-25 05:30:00


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

1.Array()

2.toArray()

3.covertArray()

4.covertoArray()

Posted Date:-2021-10-25 05:30:00


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

1.keySet()

2.getAll()

3.getKeys()

4.keyall()

Posted Date:-2021-10-25 05:30:00


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

1.binaryserach()

2.find()

3.sort()

4.get()

Posted Date:-2021-10-25 05:30:00


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

1.addElement()

2.AddElement()

3.set()

4.add()

Posted Date:-2021-10-25 05:30:00


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

1.get()

2.Elementat()

3.getProperty()

4.ElementAt()

Posted Date:-2021-10-25 05:30:00


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

1.Elementat()

2.getProperty()

3.ElementAt()

4.get()

Posted Date:-2021-10-25 05:30:00


Question:
Which of these object stores association between keys and values?

1.Map

2.Array

3.String

4.Hash table

Posted Date:-2021-10-25 05:30:00


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

1.Garbage collection

2.Serialization

3.File Filtering

4.All of the above

Posted Date:-2021-10-25 05:30:00


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

1.Serialization

2.Deserialization

3.Memory allocation

4.All of the above

Posted Date:-2021-10-25 05:30:00


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

1.LinkedList

2.HashSet

3.AbstractSet

4.AbstractList

Posted Date:-2021-10-25 05:30:00


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

1.HashSet

2.AbstractSet

3.Array

4.LinkedList

Posted Date:-2021-10-25 05:30:00


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

1.HashSet

2.AbstractSet

3.LinkedList

4.Array

Posted Date:-2021-10-25 05:30:00


More MCQS

  1. Java Mcq Question Set 1
  2. Java Mcq Question Set 2
  3. Java Mcq Question Set 3
  4. Java Mcq Question Set 4
  5. Java Mcq Question Set 5
  6. Java Mcq Question Set 6
  7. Java Mcq Question Set 7
  8. Java Mcq Question Set 8
  9. Java Mcq Question Set 9
  10. Java Multiple Choice Questions
  11. DATA TYPES IN JAVA
  12. Classes ,Constructor ,Methods,Inheritance
  13. Java Multiple Choice Questions.
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!