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


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()


Question:
All of the above

1.HashMap

2.Enumeration

3.Hashtable

4.Map


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


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()


Question:
Which of these class extend InputStream class?

1.ObjectInputStream

2.ObjectStream

3.ObjectInput

4.ObjectOutput


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

1.ArrayList

2.Map

3.Both a & b

4.Vector


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

1.Hashtable

2.Bitset

3.Map

4.All of the above


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

1.Dictionary

2.Map

3.Hashtable

4.All of the above


Question:
Which of these classes implements Set interface?

1.LinkedList

2.DynamicList

3.HashSet

4.ArrayList


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

1.LinkedList

2.HashMap

3.ArrayList

4.DynamicList


Question:
Which of these interface extends DataInput interface?

1.Serializable

2.ObjectInput

3.Externalization

4.ObjectOutput


Question:
Which of these interface extends DataOutput interface?

1.Externalization

2.Serializable

3.ObjectInput

4.ObjectOutput


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


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()


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()


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


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


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

1.Externalization

2.Serializable

3.FileFilter

4.ObjectInput


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()


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

1.Map

2.HashMap

3.Hashtable

4.Enumeration


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

1.ensureCapacity()

2.increasecapacity()

3.increaseCapacity()

4.Capacity()


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()


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

1.set()

2.put()

3.add()

4.redo()


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()


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()


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

1.add()

2.change()

3.redo()

4.set()


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()


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

1.set()

2.put()

3.addElement()

4.insertElement()


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

1.clear()

2.put()

3.set()

4.remove()


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()


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

1.trimTosize()

2.trimToSize()

3.trimSize()

4.trim()


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()


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()


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

1.bubblesort()

2.binarysort()

3.insert()

4.sort()


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()


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

1.Add()

2.add()

3.insert()

4.addFirst()


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()


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()


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()


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

1.binaryserach()

2.find()

3.sort()

4.get()


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

1.addElement()

2.AddElement()

3.set()

4.add()


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

1.get()

2.Elementat()

3.getProperty()

4.ElementAt()


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()


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

1.Map

2.Array

3.String

4.Hash table


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


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

1.Serialization

2.Deserialization

3.Memory allocation

4.All of the above


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

1.LinkedList

2.HashSet

3.AbstractSet

4.AbstractList


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

1.HashSet

2.AbstractSet

3.Array

4.LinkedList


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

1.HashSet

2.AbstractSet

3.LinkedList

4.Array


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
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite 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!