0% found this document useful (0 votes)
0 views

5_and_6

Hhdh

Uploaded by

mhaskarvikas86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

5_and_6

Hhdh

Uploaded by

mhaskarvikas86
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Unit 5 and Unit 6: Theory and Practical Questions

Set 1: Theory Questions

1. Differentiate between AWT and Swing.

2. Explain the Java Swing Class Hierarchy.

3. What are the different layouts in the Swing package? Explain any two.

4. Explain the thread life cycle in detail.

5. What is an Exception? Write about the different types of exceptions.

6. What is the role of constructors in Java? Explain constructor overloading with examples.

Set 2: Theory Questions

1. Write short notes on the Swing package.

2. Describe the benefits of multithreading and its practical applications.

3. Explain the keywords try, catch, throw, throws, and finally in exception handling.

4. Differentiate between String and StringBuffer classes with examples.

5. Write about the importance of inheritance in Java with types.

6. Describe abstract classes and their role in Java.

Set 1: Practical Questions

1. Write a Java program to create a button using the default layout and display it on a frame.

2. Write a multithreading program to print odd and even numbers using two threads.

3. Write a Java program to demonstrate the use of try, catch, and finally with exception handling.

4. Write a Java program to calculate the sum of numbers using a recursive method.

5. Write a Java program to print the current date using the java.util package.

Set 2: Practical Questions

1. Write a Java program to demonstrate the difference between String and StringBuffer by

performing string concatenation and reversal.


2. Write a Java program to implement multithreading using the Runnable interface.

3. Create a Java Swing GUI application with two buttons and handle their click events.

4. Write a Java program to demonstrate constructor overloading.

5. Write a user-defined exception program that throws an exception when a number is negative.

You might also like