Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
1. Define an Exception.
Differentiate between uncaught(unchecked) and caught(checked)
exception. 2. Explain the use of try and catch and finally features with example 3. Differentiate between throw and throws keyword with an example 4. Explain with example how to create user defined exception. 5. Develop a JAVA program to raise a custom exception (user defined exception) for DivisionbyZero using try , catch , throw, throws and finally 6. Write a program to demonstrate the use of multiple catch clauses and explain how the order of catch blocks affects the program flow. 7. Define chained exceptions. Provide a real-world scenario where they might be useful. 8. Explain the important methods in the Throwable class 9. Differentiate between process and thread. 10. Explain with example how the main method is also a thread. 11. Explain how to create multiple threads using the Thread class with an example 12. Explain the lifecycle of a thread in Java with the help of a state diagram. 13. Write a program to create multiple threads using Runnable. Demonstrate the use of isAlive() and join() methods. 14. Explain how to create multiple threads using the Runnable interface with an example 15. Explain few important methods of the Thread class 16. Explain the use of wait(),notify() and notifyAll() methods 17. Explain the concept of synchronization with example 18. Write a program to illustrate creation of threads using runnable interface .(Using start() method start each of the newly created thread .Inside the run method there is sleep() for suspend the thread for 500 milliseconds) 19. Develop a program to create a class MyThread in this class a constructor , call the base class constructor, using super and start the thread . The run method of the class starts after this. It can be observed that both main thread and created thread are excecuting concurrently. 20. Explain the exceptions ArrayIndexOutofBoundsException and ArithmeticException. 21. Explain the class hierarchy specific to exception handling. 22. Explain the concept of thread priority with an example? 23. Explain the following methods in the Thread class a.setPriority() getPriority() b.setName() getName() c.start() d.run() e.sleep() f. join() 24. What is enumeration?Explain the use of values() and valueOf() method. 25. Write a note on Wrapper classes. 26. Explain autoboxing and un boxing with example