DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
[Link]-II Year I Semester- II Mid-Term Examinations – Nov/Dec 2024
Branch: CSE SET-I Subject: OOPS Through JAVA
Answer any FOUR questions out of the SIX questions 4X5=20 Marks Time: 100mins
Blooms Course
[Link] Questions Marks
Level Outcomes
Illustrate Usage of try, catch, throw, throws, and finally with 5 L4
1. CO3
Examples ?
Complete the Exception Handling in Java? Explain with an
2 example how it works.?
5 L3 CO3
Devlop a Java program to handle a Keyboard [Link]
3 how keyboard events are handled in Java. 5 L6
CO4
Classify the different types of user interface components in
4 AWT? Brefily discussed.? 5 L2
CO4
Describe the life cycle of an applet with the help of its
5 [Link] Example Program.? 5 L1
CO5
Write a simple program that uses JButton and handles button
6 clicks using an Action Listener. 5 L6
CO5
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
[Link]-II Year I Semester-II Mid-Term Examinations – Nov/Dec 2024
Branch: CSE SET-2 Subject: OOPS Through JAVA
Answer any FOUR questions out of the SIX questions 4X5=20 Marks Time: 100mins
Blooms Course
[Link] Questions Marks
Level Outcomes
1 Compare the use of multithreading and multitasking? 5 L2 CO3
Sketch the neat diagram of Thread life cycle (e.g., New, Runnable, 5 L2
2
Blocked,Waiting, Timed Waiting, and Terminated) and explain CO3
the transitions between these states.?
Write a Java program to demonstrate the use of TextArea,
3 TextField, and Button. ?
5 L6
CO4
Complete the event classes in Java (e.g., Action Event,
4 Mouse Event, Key Event) and Explain their use in event
handling with Examples ? 5 L3 CO4
Illustarte the how Swing follows the MVC
5 architecture pattern and how it separates the user
interface (View), data (Model), and input handling 5 L4
CO5
(Controller).
Explain key Swing components such as JButton, JLabel, JText
6
Field, JCheck Box, JRadio Button, JCombo Box, etc. Include 5 L1 CO1
examples of their usage.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
[Link]-II Year I Semester-II Mid-Term Examinations – Nov/Dec 2024
Branch: CSE SET-I Subject: OOPS Through JAVA
PART-A
NAME: _____________________ Roll No. _________________
I. Choose the correct alternative Marks : 20 X 0.5=10 Time:20mins
1) Which keyword is used to manually throw an exception in Java? [ ]
a) throw b) throws c) try d) catch
2) Which of the following are checked exceptions in Java? [ ]
a) Null Pointer Exception b) Arithmetic Exception
c) Io-exception d) Array Index Out Of Bounds Exception
3. Which of the following is a built-in exception in Java? [ ]
a) Custom Exception b) Arithmetic Exception c) User Defined Exception d) Custom-error
4. Which method in Mouse-listener is used to handle mouse button press events? [ ]
a) mousePressed() b) mouseClicked() c) mouseReleased() d) mouseDragged()
5. Which of the following is the super-class of all AWT components in Java? [ ]
a) Component b) Container c) Window d) Control
6. Which of the following is used to create a clickable button in AWT? [ ]
a) TextField b) Button c) Label d) Checkbox
7. Which layout manager arranges components from left to right, top to bottom? [ ]
a) GridLayout b) BorderLayout c) FlowLayout d) CardLayout
8. What does MVC stand for in the context of Swing? [ ]
a) Model-View-Controller b) Main-View-Controller
c) Model-Variable-Component d) Model-View-Content
[Link] method is called when an applet is initialized? [ ]
a) init() b) start() c) stop() d) destroy()
[Link] Swing component is used to create a checkbox? [ ]
a) Button b) JRadioButton c) JCheckButton d) JCheckBox
II . Fill in the blanks
1. The ___________ model is used in Java to allow a program to resume execution after an exception has
been caught.
2. The ____________ model is used when a program terminates due to an exception being thrown.
3. The Java exception hierarchy is rooted at the ________________ class.
[Link] keyword _____________ is used to explicitly throw an exception in Java.
[Link] the _____________ event model, an event source passes the event to one or more listeners who handle
the event.
6.________________ is used for handling mouse events, such as mouse clicks, mouse movements, and
mouse releases.
7. The _________________ interface is used to handle keyboard events like key presses, key releases, and
key typing.
[Link] ____________ is a program that runs inside a web browser, typically embedded in an HTML page.
9. In the ______________ architecture, the View component is responsible for displaying data to the user.
[Link] _____________ method is called when an applet is destroyed.
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
[Link]-II Year I Semester-II Mid-Term Examinations – Nov/Dec 2024
Branch: CSE SET-2 Subject: OOPS Through JAVA
PART-A
NAME: _____________________ Roll No. _________________
I. Choose the correct alternative Marks : 20 X 0.5=10 Time:20mins
[Link] of the following is used to create a clickable button in AWT? [ ]
a) TextField b) Button c) Label d) Checkbox
[Link] layout manager arranges components from left to right, top to bottom? [ ]
a) GridLayout b) BorderLayout c) FlowLayout d) CardLayout
[Link] does MVC stand for in the context of Swing? [ ]
a) Model-View-Controller b) Main-View-Controller
c) Model-Variable-Component d) Model-View-Content
4..Which method is called when an applet is initialized? [ ]
a) init() b) start() c) stop() d) destroy()
5..Which Swing component is used to create a checkbox? [ ]
a) Button b) JRadioButton c) JCheckButton d) JCheckBox
[Link] keyword is used to manually throw an exception in Java? [ ]
a) throw b) throws c) try d) catch
[Link] of the following are checked exceptions in Java? [ ]
a) Null Pointer Exception b) Arithmetic Exception
c) Io-exception d) Array Index Out Of Bounds Exception
[Link] of the following is a built-in exception in Java? [ ]
a) Custom Exception b) Arithmetic Exception c) User Defined Exception d) Custom-error
9. Which method in Mouse-listener is used to handle mouse button press events? [ ]
a) mousePressed() b) mouseClicked() c) mouseReleased() d) mouseDragged()
10. Which of the following is the super-class of all AWT components in Java? [ ]
a) Component b) Container c) Window d) Control
II . Fill in the blanks
1. In the _____________ event model, an event source passes the event to one or more listeners who handle
the event.
2.__________ is used for handling mouse events, such as mouse clicks, mouse movements, and mouse
releases.
3. The _______________ interface is used to handle keyboard events like key presses, key releases, and key typing.
4. .An ____________ is a program that runs inside a web browser, typically embedded in an HTML page.
5. In the ___________ architecture, the View component is responsible for displaying data to the user.
6. The _______________ method is called when an applet is destroyed.
7. The _______________ model is used in Java to allow a program to resume execution after an exception
has been caught.
8. The ________________ model is used when a program terminates due to an exception being thrown.
9. The Java exception hierarchy is rooted at the _______________ class.
[Link] keyword ____________ is used to explicitly throw an exception in Java.