Java MCQs with answers Page - 33

Here, you will find a collection of MCQ questions on Java. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 832.27K Points
Coach

Q. Which of the following is not true?

  • (A) The Frame class extends Window
  • (B) The CheckboxMenuItem class extends the MenuItem class
  • (C) JComponent is a subclass of Container
  • (D) None of the above

A

Admin • 832.27K Points
Coach

Q. What is the correct way to write a JavaScript array?

  • (A) var txt = new Array:1=("tim")2=("kim")3=("jim")
  • (B) var txt = new Array(1:"tim",2:"kim",3:"jim")
  • (C) var txt = new Array="tim","kim","jim")
  • (D) var txt = new Array("tim","kim","jim")

A

Admin • 832.27K Points
Coach

Q. What is the correct JavaScript syntax to insert a comment that has more than one line?

  • (A) <!--This comment has more than one line-->
  • (B) /*This comment has more than one line*/
  • (C) //This comment has more than one line//
  • (D) <//This comment has more than one line//>

A

Admin • 832.27K Points
Coach

Q. 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

A

Admin • 832.27K Points
Coach

Q. Which of this package is used for remote method invocation?

  • (A) java.applet
  • (B) java.rmi
  • (C) java.lang.rmi
  • (D) java.lang.reflect

A

Admin • 832.27K Points
Coach

Q. Which of these methods are member of Remote class?

  • (A) checkIP()
  • (B) addLocation()
  • (C) AddServer()
  • (D) None of the mentioned

A

Admin • 832.27K Points
Coach

Q. Which of these Exceptions is thrown by remote method?

  • (A) RemoteException
  • (B) InputOutputException
  • (C) RemoteAccessException
  • (D) RemoteInputOutputException

A

Admin • 832.27K Points
Coach

Q. Which of this class is used for creating a client for server-client operations?

  • (A) serverClientjava
  • (B) Client.java
  • (C) AddClient.java
  • (D) ServerClient.java

A

Admin • 832.27K Points
Coach

Q. Which of this package contains classes and interfaces for networking?

  • (A) java.io
  • (B) java.util
  • (C) java.net
  • (D) java.network

A

Admin • 832.27K Points
Coach

Q. Which of these is superclass of ContainerEvent class?

  • (A) WindowEvent
  • (B) ComponentEvent
  • (C) ItemEvent
  • (D) InputEvent

Add MCQ in this Category

If you want to share an MCQ question in this category, it's a great idea! It will be helpful for many other students using this website.

Share Your MCQ