Java MCQs with answers Page - 28

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. When does Exceptions in Java arises in code sequence?

  • (A) Run Time
  • (B) Compilation Time
  • (C) Can Occur Any Time
  • (D) None of the mentioned

A

Admin • 832.27K Points
Coach

Q. What is multithreaded programming?

  • (A) It’s a process in which two different processes run simultaneously.
  • (B) Its a process in which two or more parts of same process run simultaneously.
  • (C) Its a process in which many different process are able to access same information.
  • (D) Its a process in which a single process can access information from many sources.

A

Admin • 832.27K Points
Coach

Q. Which of these are types of multitasking?

  • (A) Process based multitasking
  • (B) Thread based multitasking
  • (C) Both a & b
  • (D) None of the mentioned

A

Admin • 832.27K Points
Coach

Q. Which of these packages contain all the Java’s built in exceptions?

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

A

Admin • 832.27K Points
Coach

Q. Thread priority in Java is?

  • (A) Integer
  • (B) Float
  • (C) Double
  • (D) Long

A

Admin • 832.27K Points
Coach

Q. What will happen if two thread of same priority are called to be processed simultaneously?

  • (A) Any one will be executed first lexographically
  • (B) Both of them will be executed simultaneously
  • (C) None of them will be executed
  • (D) It is dependent on the operating system.

A

Admin • 832.27K Points
Coach

Q. Which of these statements is incorrect?

  • (A) By multithreading CPU’s idle time is minimized, and we can take maximum use of it.
  • (B) By multitasking CPU’s idle time is minimized, and we can take maximum use of it.
  • (C) Two thread in Java can have same priority
  • (D) A thread can exist only in two states, running and blocked.

A

Admin • 832.27K Points
Coach

Q. Which method executes only once

  • (A) start() method
  • (B) init() method
  • (C) stop() method
  • (D) destroy() method

A

Admin • 832.27K Points
Coach

Q. Thread class is available in

  • (A) java.io package
  • (B) java.lang package
  • (C) java.awt package
  • (D) java.util package

A

Admin • 832.27K Points
Coach

Q. Minimum threads in a program are

  • (A) 1
  • (B) 2
  • (C) 5
  • (D) Many

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