Java Multithreading and Exception Handling
Description: Java Multithreading and Exception Handling | |
Number of Questions: 28 | |
Created by: Ankita Patil | |
Tags: Java Multithreading and Exception Handling Java Basics Multithreading and Garbage Collection |
Which of the following methods is/are correct for making a new thread? A. Declare a class to be a subclass of Thread class. B. Declare a class that implements the Runnable class.
The code we want to execute has to be placed in a method ________ of the class which extends class Thread.
Which one of the following is the correct structure to create and run a thread?
Which one of the following is not a correct state for life cycle of a thread?
When an allocated time of a thread is over, JRE puts it back in the _____ state.
Which one of the following is not a valid thread priority constant?
FirstTh th=new FirstTh(); Thread sm=new Thread(th).start(); Which of the following statements is correct with respect to the above code?
Which of the following methods makes the current thread to wait until other specified thread terminates?
The methods wait(), notify() and notifyAll() must be called only when they own the monitor of that object, otherwise they throw __________________.
The class Timer and TimerTask are available in the package __________.
Which one of the following is not a valid constructor of Timer class?
What is the use of purge() method in Timer class?
Which of the following statements is/are correct? A. The sleep() method is used to permanently stop the execution of the thread. B. The join() method is used to wait for this thread to die.
Suppose a thread wants some input data. It cannot continue unless it is made available by the OS. Such a state is called a _________ state.
What is the use of destroy() method of thread class?
Which of the following correctly represents the exception?
Which of the following packages defines a class Throwable?
Throwable class has two sub-classes, ________ and __________.
Java has defined a _______________ class which is a super-class for all runtime error classes.
The code which is likely to produce exception is kept within the ___________ block.
A block labelled as finally will _________.
The throw statement is used to throw the _____ type exception.
Which of the following exceptions occurs, if one is trying to access an element of array with an index that is larger than the range?
Which of the following exceptions is not a sub-class of RuntimeException?
An instance of ThreadDeath is thrown in the victim thread when the stop method is called with ____ arguments.
Which of the following statements is/are correct? A. A finally block is optional. B. throw and throws are the same.
What is the return type of start() method of class Thread?
In Java, the concept of synchronisation is based on the concept of ___________.