Java Programming MCQ (Multiple Choice Questions) - SchoolingAxis

Java Programming MCQ (Multiple Choice Questions)

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

a. ArrayList

b. Map

c. Vector

d. ArrayList & Vector


Answer- ArrayList & Vector


Que-  Which of these are legacy classes?

a. Stack

b. Hashtable

c. Vector

d. All of the mentioned


Answer- All of the mentioned


Que-  Which of these is the interface of legacy?

a. Map

b. Enumeration

c. HashMap

d. Hashtable


Answer- Enumeration


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

a. length

b. elements

c. elementCount

d. capacity


Answer- elementCount


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

a. add()

b. set()

c. AddElement()

d. addElement()


Answer- addElement()


Que-  Which of these class object uses the key to store value?

a. Dictionary

b. Map

c. Hashtable

d. All of the mentioned


Answer- All of the mentioned


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

a. put()

b. set()

c. insertElement()

d. addElement()


Answer- put()


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

a. Map

b. Enumeration

c. HashMap

d. Hashtable


Answer- Map


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

a. Array

b. ArrayList

c. Dictionary

d. Properties


Answer- Properties


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

a. get()

b. Elementat()

c. ElementAt()

d. getProperty()


Answer- getProperty()


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

a. Bitset

b. Map

c. Hashtable

d. All of the mentioned


Answer- Bitset


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

a. put()

b. set()

c. remove()

d. clear()


Answer- clear()


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

a. size()

b. length()

c. indexes()

d. numberofBits()


Answer- length()


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

a. after()

b. contains()

c. before()

d. compareTo()


Answer- before()


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

a. get()

b. Elementat()

c. ElementAt()

d. getProperty()


Answer- get()


Que-  What is Remote method invocation (RMI)?

a. RMI allows us to invoke a method of java object that executes on another machine

b. RMI allows us to invoke a method of java object that executes on another Thread in multithreaded programming

c. RMI allows us to invoke a method of java object that executes parallely in same machine

d. None of the mentioned


Answer- RMI allows us to invoke a method of java object that executes on another machine


Que-  Which of these package is used for remote method invocation?

a. java.applet

b. java.rmi

c. java.lang.rmi

d. java.lang.reflect


Answer- java.rmi


Que-  Which of these methods are member of Remote class?

a. checkIP()

b. addLocation()

c. AddServer()

d. None of the mentioned


Answer- None of the mentioned


Que-  Which of these Exceptions is thrown by remote method?

a. RemoteException

b. InputOutputException

c. RemoteAccessException

d. RemoteInputOutputException


Answer- RemoteException


Que-  Which of these class is used for creating a client for a server-client operations?

a. serverClientjava

b. Client.java

c. AddClient.java

d. ServerClient.java


Answer- AddClient.java


Que-  Which of these package is used for all the text related modifications?

a. java.text

b. java.awt

c. java.lang.text

d. java.text.modify


Answer- java.text


Que-  Which of these packages contain all the collection classes?

a. java.lang

b. java.util

c. java.net

d. java.awt


Answer- java.util

Previous Post Next Post