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

Java Programming

The document is an examination paper for a B.Sc. degree in Computer Science focusing on Java programming, consisting of multiple-choice questions and descriptive sections. It covers various topics such as Java buzzwords, JVM, thread creation, AWT components, and file handling. The exam is structured into three parts, with a total of 75 marks available.

Uploaded by

rushyan122007
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)
5 views3 pages

Java Programming

The document is an examination paper for a B.Sc. degree in Computer Science focusing on Java programming, consisting of multiple-choice questions and descriptive sections. It covers various topics such as Java buzzwords, JVM, thread creation, AWT components, and file handling. The exam is structured into three parts, with a total of 75 marks available.

Uploaded by

rushyan122007
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

C23U203CSC OA

(6 pages) 3. Which statement is used for decision-makíng in


[Link]. 2799 23UCS04 Java?
(a) switch (b) do-while

(For the candidates admitted from 2023-2024 onwards)


(c) for (d) import

[Link]. DEGREE EXAMINATION, APRILMAY 2025 4 Which keyword is used to prevent a class from
being inherited?
Fourth Semester
(a) static (b) final
Computer Science (c) abstract (d) protected

JAVA PROGRAMMING 5. Method Overloading is an example, of

Time:Three hours Maximum: 75 marks


(a) Static Polymorphism
PART A -(15x 1= 15 marks) (b) Dynamic Polymorphism
Answer ALL questions. (c) Inheritance
1. Which of the following is NOT a Java buzzword? Encapsulation
(d)
(a) Secure
(b) Platform-dependent 6. What is used to import an entire package in
(c) Object-oriented Java?
(d) Robust (a) import package_nam.*
2. What is JVM stand for? (b) include package_name.*
(a) Java Virtual Memory (c) using package_name.*
(b) Java Verified Machine
(c) Java VirtualMachine (d) package package_name.*
(d) Java Variable Machine 2 [Link]. 2799
7. Which of the following is the correct way to create 12. What is the purpose of an adapter class in AWT?
a thread in Java? (a) To provide default implementations
(a) Extending Thread class (b) To create custom events

(b) Implementing Runnable interface (c) To generate layout


(c) Both (a) and (b) (d) To manage fonts
(d) Using [Link]() directly
13. Which of the following statements is true about
8. Which of the following is used for inter-thread Swing components?
communication in Java? Swing components are heavy weight
(a)
(a) notify( ) (b) wait() (b) Swing is part of the [Link] package
(c) notifyAll() (d) all of the above (c) Swing components are platform
independent
9. Which of the following is a byte stream class?
(d) Swing does not support event handling
(a) FileReader (b) BufferedReader
(c) FileinputStream (d) Printwriter 14. Which method is used to set the text of a JLabel?
(a) setLabel( ) (b) setText()
10. Which AWT component cannot receive input from
the user? (c) changeText() (a) updateText( )
(a) TextField (b) Label l5. Which method is used to add components like
(c) Button (d) TextArea buttons and labels to a Jframe?

11. The Frame class in AWT is a subclass of which (a) insert(Component c)


class? (b) add(Component c)
(a) Component (b) Window (c) attach(Component c)
(c) Panel (d) Container (d) append(Component c)
3 [Link]. 2799 4 [Link]. 2799
P.T.0.]
PART B-(2x5= 10 marks) 22. (a) Elucidate different types of inheritance in
Java with examples.
Answer any TWO questions. Or
16. Differentiate between String and StringBuffer (b) Discuss about the different types of
classes in Java. exceptions in Java with examples.
17. Explain the role of "this" and "super" keywords in 23. (a) Explain File Handling using
Java. FileInputStream and FileOutputStream in
Java with example.
18. Differentiate between Byte Streamns and Or
Character Streams in Java. (b) How Can we avoid deadlocks in
multithreading? Explain with example.
19. Narrate about the role of layout managers in
AWT. 24. (a) Describe how to handle mouse and keyboard
events in Java AWT.
20. Differentiate between JtextField and JtextArea Or
with suitable examples. (b) Explain the usage of Menu in Java AWT.
How do they enhance GUI?
PART C (5x 10 = 50 marks)
25. (a) Elucidate about JButton, JToggleButton,
Answer ALL questions. JCheckBox and JRadioButton. Include code
21. (a) Describe the different data types in Java snippets to demonstrate their usage.
Or
with examples.
(b) What is JScrolPane and how does it
Or enhance GUI applications? Demonstrate its
usage with an example in Swing.
(b) Write a Java program to demonstrate the
usage of static variables, static methods and
static blocks.
5 [Link]. 2799 6 [Link]. 2799

You might also like