Menu

Objective Type Questions & Answers


Object Oriented Programming through Java MCQs - Unit-3



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

Answer



2. Which of these keywords is not a part of exception handling?

A . try

B . finally

C . thrown

D . catch

Answer



3. Which of these keywords must be used to monitor for exceptions?

A . try

B . finally

C . throw

D . catch

Answer



4. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?

A . try

B . finally

C . throw

D . catch

Answer



5. Which of these keywords is used to manually throw an exception?

A . try

B . finally

C . throw

D . catch

Answer



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

Answer



7. Which of these keywords is not a part of exception handling?

A . try

B . finally

C . thrown

D . catch

Answer



8. Which of these keywords must be used to monitor for exceptions?

A . try

B . finally

C . throw

D . catch

Answer



9. Which of these keywords must be used to handle the exception thrown by try block in some rational manner?

A . try

B . finally

C . throw

D . catch

Answer



10. Which of these is a super class of all errors and exceptions in the Java language?

A . Catchable

B . Throwable

C . RunTimeExceptions

D . None of the above

Answer



11. In which of the following package Exception class exist?

A . java.file

B . java.lang

C . java.io

D . java.util

Answer



12. Which exception is thrown when divide by zero statement executes?

A . NumberFormatException

B . NullPointerException

C . ArithmeticException

D . None of these

Answer



13. What is multithreaded programming?

A . It`s a process in which two different processes run simultaneously

B . It`s a process in which two or more parts of same process run simultaneously

C . It`s a process in which many different process are able to access same information

D . It`s a process in which a single process can access information from many sources

Answer



14. Which of these are types of multitasking?

A . Process based

B . Thread based

C . Process and Thread based

D . None of the mentioned

Answer



15. Thread priority in Java is?

A . Integer

B . Float

C . double

D . long

Answer



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

A . Anyone 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

Answer



17. Which of these statements is incorrect?

A . By multithreading CPU idle time is minimized, and we can take maximum use of it

B . By multitasking CPU idle time is minimized, and we can take maximum use of it

C . Two thread in Java can have the same priority

D . A thread can exist only in two states, running and blocked

Answer



18. Which of these keywords are used to implement synchronization?

A . synchronize

B . syn

C . synch

D . synchronized

Answer



19. Which of this method is used to avoid polling in Java?

A . wait()

B . notify()

C . notifyAll()

D . all of the mentioned

Answer



20. Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?

A . wait()

B . notify()

C . notifyAll()

D . sleep()

Answer



21. Which of these method wakes up the first thread that called wait()?

A . wake()

B . notify()

C . start()

D . notifyAll()

Answer



22. Which of these method wakes up all the threads?

A . wakeAll()

B . notify()

C . start()

D . notifyAll()

Answer



23. What is synchronization in reference to a thread?

A . It`s a process of handling situations when two or more threads need access to a shared resource

B . It`s a process by which many thread are able to access same shared resource simultaneously

C . It`s a process by which a method is able to access many different threads simultaneously

D . It`s a method that allow too many threads to access any information the require

Answer



24. Which of these keywords are used to implement synchronization?

A . synchronize

B . syn

C . synch

D . synchronized

Answer



25. Which of these method is used to tell the calling thread to give up a monitor and go to sleep until some other thread enters the same monitor?

A . wait()

B . notify()

C . notifyAll()

D . sleep()

Answer



26. How can synchronization be achieved in Java threads? 

A . Using the synchronized keyword.

B . Using the volatile keyword.

C . Using the final keyword.

D . Using the static keyword.

Answer



27. What is a thread in Java? 

A . A lightweight process that executes a sequence of instructions.

B . A memory allocation unit in Java.

C . A Java keyword to define a loop construct.

D . A data structure to store multiple values.

Answer



28. Which class is used to create a thread in Java? 

A . Thread

B . Runnable

C . Process

D . Executor

Answer



29. What is the purpose of the wait() method in Java threads? 

A . To pause the execution of a thread.

B . To terminate a thread.

C . To notify other threads to resume execution.

D . To release the lock held by the thread.

Answer



30. Which method is used to start the execution of a thread? 

A . execute()

B . run()

C . start()

D . begin()

Answer





Relevant Materials :

Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]

Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]


Similar Materials :

R - Programming MCQs - Unit-1 - [ R-Programming ]

R - Programming MCQs - Unit-2 - [ R-Programming ]

R - Programming MCQs - Unit-3 - [ R-Programming ]

R - Programming MCQs - Unit-4 - [ R-Programming ]

R - Programming MCQs - Unit-5 - [ R-Programming ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]

Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]

PPS MCQs - Unit-1 - [ PPS ]

PPS MCQs - Unit-2 - [ PPS ]

PPS MCQs - Unit-3 - [ PPS ]

PPS MCQs - Unit-4 - [ PPS ]

PPS MCQs - Unit-5 - [ PPS ]

Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]

Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]

Software Engineering MCQs - Unit-1 - [ SE ]

Software Engineering MCQs - Unit-2 - [ SE ]

Software Engineering MCQs - Unit-3 - [ SE ]

Software Engineering MCQs - Unit-4 - [ SE ]

Software Engineering MCQs - Unit-5 - [ SE ]

Data Mining MCQs - Unit-1 - [ DM ]

Data Mining MCQs - Unit-2 - [ DM ]

Data Mining MCQs - Unit-3 - [ DM ]

Data Mining MCQs - Unit-4 - [ DM ]

Data Mining MCQs - Unit-5 - [ DM ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]

Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]

Data Structures Objective Type Question Bank-Unit-1 - [ DS ]

Data Structures Objective Type Question Bank-Unit-2 - [ DS ]

Data Structures Objective Type Question Bank-Unit-3 - [ DS ]

Data Structures Objective Type Question Bank-Unit-4 - [ DS ]

Data Structures Objective Type Question Bank-Unit-5 - [ DS ]

Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]

Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]

Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]

Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]

Java Programming Objective Type Question Bank - [ Java Programming ]

Java Programming Objective Type Questions-Part-1 - [ Java Programming ]

Java Programming Objective Type Questions-Part-2 - [ Java Programming ]