Test 1 27 Jan,2022 boomtecho2@gmail.comLeave a comment Please enter your email: 1. The Parent class of the extensions in java is : Throwable Throw Exception Throws 2. The two subclasses of Throwable are : Error and Assertion Error and Exception Checked and Unchecked Error and Runtime Exception 3. Which type of Exception does a sleep() method throw? Arithmetic Exception Null Pointer Exception Array Index out of Bound Exception Interrupted Exception 4. What are the two types of Exceptions available in java ? Checked and Compiled Unchecked and Compiled Checked and Unchecked Compiled and non compiled 5. Which state is entered once a thread is created ? Ready Running New Terminated 6. How Many Thread running at a time? One Two Three Four 7. Which method is used to know the current state of the Thread: get Thread State() get State() get Thread() get Thread Current State() 8. The life cycle of a thread in java is controlled by JVM JDK JRE None 9. Execution of a java thread begins on which method call? start() run() execute() launch() 10. How many ways a thread can be created in Java multithreading? 1 2 3 4 11. Which method is used to make main thread to wait for all child threads join() sleep() wait() stop() 12. Default value of a java thread is 0 1 5 10 13. If a priority of a java thread is 3 then the default priority of its child thread will be 0 1 5 3 14. Which method is used to check if a thread is running? isAlive() alive() run() keepAlive() 15. Min and Max priority of a thread in Java multithreading are 1,10 0,10 0,255 1,256 16. Which method we implement from Runnable interface? Run() Start() Execute() Call() 17. Which method is used to wait for child threads to finish in Java? wait() sleep() join() isAlive() 18. Which will contain the body of the thread in Java? start() run() main() execute() 19. Which package contains Thread classes and interfaces? java.lang java.io java.util java.thread 20. Which of the following interface is used to create a Thread? Thread Runnable Cloneable Serializable 21. Which class is used to create a Thread ? Thread Runnable Thread Group Synchronization 22. Name the Exception thrown by the Read method defined in the Inputstream class : Arithmetic Exception Null Pointer Exception IO Exception Illegal Access Exception 23. What is the exception raised of the following codes: String str = “123ABC”; int a = Integer.parseInt(str); Arithmetic Exception Null Pointer Exception Number Format Exception IO Exception 24. when does exception in java arises in code : At compile time At Run time At codding time All are true 25. Which of these keywords is not part of Exception handling: Finally Thrown Catch Try 26. Which Exception is thrown when divideĀ by Zero statement executes as : int a = 10/0; Number Format Exception Null Pointer Exception Arithmetic Exception None of the Above 27. Which of the following are not the methods of the Thread class? Yield() Sleep() Go() Stop() 28. What do you mean by chained exceptions in java? Exceptions occured by Virtual machine Error Exception caused by other Exceptions Exceptions occur in chain with discarding the debugging information none of the above 29. When a Thread starts, which method is called automatically to run the Thread? start() up() run() exec() Loading …