Java MCQs with answers Page - 13

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 these classes is related to all the exceptions that can be caught by using catch?

  • (A) Error
  • (B) Exception
  • (C) a & b
  • (D) None of these

A

Admin • 832.27K Points
Coach

Q. Which of these classes is related to all the exceptions that cannot be caught?

  • (A) Error
  • (B) Exception
  • (C) a & b
  • (D) None of these

A

Admin • 832.27K Points
Coach

Q. Standard output variable ‘out’ is defined in which class?

  • (A) Void
  • (B) Process
  • (C) Runtime
  • (D) System

A

Admin • 832.27K Points
Coach

Q. Which of these packages contains all the event handling interfaces?

  • (A) java.lang
  • (B) java.awt
  • (C) java.awt.event
  • (D) java.event

A

Admin • 832.27K Points
Coach

Q. Which of these exceptions handles the divide by zero error?

  • (A) ArithmeticException
  • (B) MathException
  • (C) IllegalAccessException
  • (D) IllegarException

A

Admin • 832.27K Points
Coach

Q. Which of these exceptions will occur if we try to access the index of an array beyond its length?

  • (A) ArithmeticException
  • (B) ArrayException
  • (C) ArrayIndexException
  • (D) ArrayIndexOutOfBoundsException

A

Admin • 832.27K Points
Coach

Q. What decides thread priority?

  • (A) Process
  • (B) Process scheduler
  • (C) Thread
  • (D) Thread scheduler

A

Admin • 832.27K Points
Coach

Q. Which of the following will ensure the thread will be in running state?

  • (A) yield()
  • (B) notify()
  • (C) wait()
  • (D) Thread.killThread()

A

Admin • 832.27K Points
Coach

Q. Which of these is used to read a string from the input stream?

  • (A) get()
  • (B) getLine()
  • (C) read()
  • (D) readLine()

A

Admin • 832.27K Points
Coach

Q. Which of these methods can be used to output a string in an applet?

  • (A) display()
  • (B) print()
  • (C) drawString()
  • (D) tr