Question Bank for Unit 3-4
1. Explain abstract class with the help of an example program.
2. Explain abstract methods with the help of example program.
3. Explain interface? Give its syntax and purpose.
4. Design an abstract class Shape with an abstract method calculateArea(). Create two
subclasses Circle and Rectangle that implement this method. Explain your code and the
implementation process.
5. Differentiate between abstract methods and interface.
6. Explain the concept of package in Java. Give 4 examples of inbuilt packages.
7. Describe the purpose of packages in Java. Differentiate between built-in and user-defined
packages with examples.
8. Differentiate between checked and unchecked exceptions?
9. Differentiate between byte stream and character stream classes with examples.
10. Write a short note on Exception class hierarchy.
11. Explain the steps to create and import a user-defined package with syntax.
12. Define an abstract class. How is it implemented in Java?
13. What is an interface in Java? Explain how to implement an interface with an example.
14. What is a package? How do you create and import a user-defined package?
15. Explain the use of try, catch, and finally blocks in Java exception handling.
16. What is the purpose of throw and throws statements? Give suitable examples.
17. Define a user-defined exception. How do we create and use it in Java?
18. Describe the Thread Life Cycle with a neat diagram.
19. Describe how threads are created in Java using Thread class and Runnable interface with
suitable example programs
20. Draw and explain the Java I/O class hierarchy.
21. Differentiate between byte stream and character stream classes with examples.
22. What is the purpose of BufferedReader and BufferedWriter classes? Give a short example.
23. What is the PrintWriter class? Mention any two features with a simple example.
24. Write a program in java to read content from user and write it in a file using character
stream classes.
25. What is multithreading? List its advantages in Java.
26. Explain the different states of the thread life cycle.
27. How is a thread created using Thread class and Runnable interface? Compare both.
28. Write a short note on the main thread and its properties.
29. What is thread synchronization? Why is it needed?
30. Explain thread communication using wait(), notify(), and notifyAll().
31. Write a short note on BufferedReader and BufferedWriter classes.
32. Write a detailed note on Exception Handling using try, catch, finally with a complete
program.
33. Explain the IO Stream Hierarchy in detail. Write a program to copy content from one file to
another using character streams.
34. Write a short note on PrintWriter class with example program.
35. Explain the concept of streams in Java. Differentiate between byte stream and character
stream classes, mentioning the main class names of each type.
36. Explain the BufferedReader and BufferedWriter classes in detail. Analyze why buffering
improves performance,
37. Write a program to create two threads using Runnable interface, perform a task, and display
thread properties such as name and priority.
38. Explain the use of finally with the help of an example program.