java question bank module 5 & 6
java question bank module 5 & 6
31 What is the difference between extending the Thread class and implementing 2 4 1
the Runnable interface?
Section B BTL
3 What is a sub-package in Java? Explain how you can create and use sub-packages. 6 3 2
4 What are the advantages of using packages in Java? Discuss with examples. 6 3 2
7 What is AWT in Java? Explain its key components and how they help in building 6 3 2
graphical user interfaces (GUIs).
8 Explain the role of containers in AWT. What are the different types of containers 6 3 2
in AWT?
10 What is the role of Frame class in AWT? How is it different from other containers 6 3 2
like Panel?
11 How does AWT differ from Swing in Java? Discuss their key differences and 6 3 2
similarities.
15 What is the difference between throw and throws in exception handling? Explain 6 3 2
with an example.
16 What are Error and Exception classes in Java? Discuss their differences. 6 3 2
21 Explain how the wait(), notify(), and notifyAll() methods are used for 6 4 2
inter-thread communication.
28 What is event handling in AWT? Explain how AWT handles user input events. 6 4 2
29 Explain the concept of AWT components. What are the main AWT components? 6 4 2
Section C
1 What is the purpose of the import statement in Java? Explain with an 8 3 3
example how it is used to access classes from a package.
2 Explain the Thread class in Java. How can you create a thread 8 3 3
using this class?
3 What is exception handling in Java? Explain the key 8 3 3
components involved in exception handling.
4 Explain the concept of event handling in AWT. How are events handled in AWT? 8 3 3
10 What are the rules for naming packages in Java? Provide guidelines and 8 4
examples.
Section D
1 Explain the architecture of AWT in Java with a detailed discussion on the role of 10 3 4
containers, components, layout managers, and event handling.
2 Explain the concept of packages in Java. Discuss the types of packages in Java, 10 3 4
how to create and use user-defined packages, and how packages help in
organizing Java classes. Provide examples of using built-in and user-defined
packages.
3 What is the role of the try-catch block in Java? Explain how multiple 10 3 4
exceptions can be handled using the try-catch block. Provide an example.
4 Explain the concept of multithreading in Java. Describe how threads are created, 10 4 4
managed, and synchronized in Java, and provide examples of creating threads
using the Thread class .Also, explain how synchronization helps avoid thread
interference and consistency problems.
5 What is the difference between System.exit() and return in 10 4 4
exception handling in Java?
BTL are:
1. Remembering
2. Understanding,
3. Applying,
4. Analysing,
5. Evaluating
6. Creating