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

MID - 2 JAVA OBJECTIVE

The document outlines a Java programming curriculum covering topics such as exception handling, event handling, and Swing framework. It includes multiple-choice questions and fill-in-the-blank prompts related to Java concepts. The content is structured into units, focusing on key Java programming principles and components.

Uploaded by

pillala sathish
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

MID - 2 JAVA OBJECTIVE

The document outlines a Java programming curriculum covering topics such as exception handling, event handling, and Swing framework. It includes multiple-choice questions and fill-in-the-blank prompts related to Java concepts. The content is structured into units, focusing on key Java programming principles and components.

Uploaded by

pillala sathish
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

JAVA PROGRAMMING

COMMON TO CSE(CS) & AIDS


UNIT-3
1. When does Exceptions in Java arises in code sequence? [ ]
a) Run Time c) Can Occur Any Time
b) Compilation Time d) None of the mentioned

2. Which of these keywords is not a part of exception handling? [ ]

a) try c) thrown
b) finally d) catch

3. Which of these keywords must be used to monitor for exceptions? [ ]

a) try c) throw
b) finally d) catch

4. Which of these keywords must be used to handle the exception thrown by try block in
some rational manner? [ ]

a) try c) throw
b) finally d) catch

5. The ____ keyword is used to throw an exception in Java

6. . A ----------------- is a collection of classes and interfaces


7. An ----------------- is an object that is generated when a run time error occurs.
8. The_____________ statement is used to include another Java package in a Java source
file.

UNIT-4

1. Event class is defined in which of these libraries? [ ]


a) java.io c) java.net
b) java.lang d) java.awt.event
2. Which of these methods can be used to determine the type of event? [ ]
a) getID() c) getEvent()
b) getSource() d) getEventObject()
3. Which of these class is super class of all the events? [ ]
a) EventObject c) ActionEvent
b) EventClass d) ItemEvent
4. Which of these events will be notified if scroll bar is manipulated? [ ]
a) ActionEvent c) AdjustmentEvent
b) ComponentEvent d) WindowEvent
5.. Which of these events will be generated if we close an applet’s window? [ ]
a) ActionEvent c) AdjustmentEvent
b) ComponentEvent d) WindowEvent
6. Which of these methods are used to register a keyboard event listener? [ ]
a) KeyListener() c) addKeyListener()
b) addKistener() d) eventKeyboardListener()
7. Which of these methods are used to register a mouse motion listener? [ ]
a) addMouse() c) addMouseMotionListner()
b) addMouseListener() d) eventMouseMotionListener()
8. Event class is defined in which of these libraries? [ ]
a) java.io c) java.net
b) java.lang d) java.awt.event
9. .______________________________________________ is the full form of AWT?
10 .Boxing is ______________________________________________
11. To process scroll bar events, you need to implement ________________ interface
12. ______ is an object that describes a state change in the source
13. In case of_____________________we can implement only required methods of any
interface
14. Listeners are created by implementing one or more of the defined by
the_______________
15._____________ layout manager arranges components in a grid of rows and columns?
16. ____________layout manager arranges components in a single row or column?
17._____________ event is generated when a user clicks a button in AWT?
18. __________event is generated when a window is resized in AWT?

UNIT-5
1. Which of these functions is called to display the output of an applet? [ ]
a) display() c) displayApplet()
b) paint() d) PrintApplet()

2. Which of these methods can be used to output a string in an applet? [ ]

a) display() c) drawString()
b) print() d) transient()

3. Which of the following architecture does the Swing framework use [ ]

a) MVC c) Layered architecture


b) MVP d) Master-Slave architecture

4. Which language is used in the swing framework? [ ]

a) JavaScript c) React
b) Java d) Python

5. In Swing, the ____ is used to render visuals and listen for events? [ ]

a) Event adapters c) Event listener


b) Events Handler d) Event-Driven Thread

6. An ____ is a short software that runs in a web browser. [ ]

a) Application c) Applet
b) AWT d) JFrame

7. A _ is a container that provides a viewport for showing a piece of a bigger component.[ ]

a) JScrollPanel c) JScroll
b) JScrollBox d) JScrollPane

8. The ____ function allows you to paint with a Graphics object. [ ]

a) AllPaint() c) Repaint()
b) Jpaint() d) paint()

9. MVC Stands for_____________________________________


10. A ___________________ is the basic class for all SWING UI components?
11. The________________ method is called to clear the screen and calls the paint( ) method.
12. Swing framework is __________________________________ component?

13. invokeandwait() method in Swing framework is __________________________


14. Swing components are not implemented by ___________________________ code
15. ___________________package needs to be imported for using Swing Classes
16. Class _____________________ Encapsulates a table-based control
17. Items are added to the JComboBox using __________________ method
18. A tree presents ______________________________ view of data

You might also like