0% found this document useful (0 votes)
10 views3 pages

Important Questions MID II OOPJ QP (R22)

The document contains a series of short and long questions related to Object-Oriented Programming (OOP) using Java, covering topics such as threads, AWT components, event handling, and Swing. It includes questions on the differences between various UI elements, the lifecycle of threads and applets, and the MVC architecture. Additionally, it prompts for explanations and examples of Java concepts, as well as practical programming tasks.
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)
10 views3 pages

Important Questions MID II OOPJ QP (R22)

The document contains a series of short and long questions related to Object-Oriented Programming (OOP) using Java, covering topics such as threads, AWT components, event handling, and Swing. It includes questions on the differences between various UI elements, the lifecycle of threads and applets, and the MVC architecture. Additionally, it prompts for explanations and examples of Java concepts, as well as practical programming tasks.
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/ 3

Short Questions Subject: OOPs Through Java

1. How can we create a thread in Java?

2. Mention one difference between a user thread and a daemon thread.

3. Name the base class of all AWT components.

4. Differentiate between a checkbox and a radio button in AWT.

5. List out limitations of AWT.

6. What is the need of JTable ?

7 In java, how do you specify that an event should trigger a particular method for event
handling?

8 Mention any two types of events handled in Java.


9 Mention one key difference between applet and application.
10 What is a servlet?

11. What will be the output of the program?

class MyThread extends Thread


{
public static void main(String [] args)
{
MyThread t = new MyThread();
t.start();
System.out.print("one. ");
t.start();
System.out.print("two. ");
}
public void run()
{
System.out.print("Thread ");
}
}

12. Which method is used to create a daemon thread?

13. A ____ is the basic class for all SWING UI components?

14. Which component gives a drop-down list of options from which to choose?
15. the SWNG classes are contained in the--------- package.

16. List the constructors of Tabbed Panes class?

Page 1 of 3
17 Which interfaces define actionPerformed() method?

18 List the methods defined in MouseMotionAdapter class.

19 What is the length of the application box made by the following Java program?
import java.awt.*;
import java.applet.*;
public class myapplet extends Applet
{
public void paint(Graphics g)
{
g.drawString("A Simple Applet", 20, 20);
}
}

20 What is a Servlet?
21 What are the benefits of Swing over AWT?
22 When can gridbag layout manager be used?
23 Differentiate between Scrollbar and Scrollpane.
25 How do Model, View, and Controller interact?

Long Questions:

1. a) Explain the thread life cycle in detail with a neat diagram. b) Describe the role of each
method (start(), sleep(), join(), wait())

2. Explain thread priorities and synchronization mechanisms in Java with suitable example
programs.

3. Explain the AWT class hierarchy with a neat diagram.

4. Design an Employee Information Form using Swing that contains:


• TextFields for Employee ID, Name, and Salary
• ComboBox for Department selection
• CheckBoxes for skills (Java, Python, C++)
• A Submit button that displays the details entered in a JTable.
5. Describe stepwise procedure of the Event Handling mechanism in Java. Discuss Action
event with example Program.

6. a) Write and explain a simple Java applet program that draws a geometric shape using
the Graphics class.

b) Explain how parameters are passed to an applet using HTML tags and Java methods.

Page 2 of 3
7 Write a java program that creates 3 threads that the 1st thread to display GOOD
MORNING for every 1second, 2nd thread to display HELLO for every 2seconds and the
3rd thread to display WELCOME for every 3 seconds.

8 Explain the following terms with an Example.


1. Enumerations 2. Autoboxing 3. Generics

9 What are the subclasses of JButton class of swing package? Implement any one button.
10 Explain the following components with examples.
Combo boxes 2. Tabbed Panes
11 What are the methods supported by keyListener and MouseListener interface? Write a
program to handle mouse events.
12 a) Describe the life cycle of an applet with a neat diagram.
b) Write a procedure to create and execute a simple Applet Program.
13 a).Differentiate between checkbox and Checkboxgroup.
b)Explain the following with an example.
i).JButton
ii).JLabel
14 List out the types of Layout managers in java.
Explain any two of them with an example
15 Describe the role of Model, View and Controller in MVC architecture with a neat
diagram and suitable example.

Page 3 of 3

You might also like