II-I cse-aids-aiml-cse(aiml)-cse(DS)_JAVA_QUESTION[1]
II-I cse-aids-aiml-cse(aiml)-cse(DS)_JAVA_QUESTION[1]
COLLEGEOFENGINEERING&TECHNOLOGY
(ANAUTONOMOUS INSTITUTION)
PEERANCHERU,HYDERABAD-500091
B.Tech.IYearISemester(R23Regulation)
QUESTION BANK [CSE,AIDS,AIML,CSE (AIML),CSE(DS)]
OBJECT ORIENTED PROGRAMMING THROUGH JAVA
SHORT ANSWER QUESTIONS.
UNIT I
UNIT II
1. Differentiate between a base class and a sub class?
2. Define polymorphism in java?
3. Mention the importance of marking a method as final in Java?
4. Highlight the distinction between a class and an interface in Java?
5. List out benfits of stream oriented I/O?
UNIT III
UNIT IV
UNIT V
2. Identify the Swing component used for displaying a text box for user input?
5. What is a swing?
LONG ANSWER QUESTIONS UNIT I
1) a) What is the role of constructors in Java? Explain the types of constructors with examples
b) Compare while and do-while loops in Java. Provide examples and discuss when to use each [5+5]
2) a) Write in detail about Classes, Objects and Methods
b)Briefly write about Inheritance, Overriding and Exceptions.
[5+5]
3) a) What is Object-Oriented Programming? Explain the principles of Object-Oriented Programming.
b)What is is the String class in Java? Explain any tive commonly used methods in the String class with examples
[5+5]
4) a) What is the role of constructors in Java? Explain the types of constructors with example.
b)Briefly write about Inheritance, Overriding and Exceptions. [5+5]
UNIT II
5) a) What are the types of inheritance in Java? Explain their benefits and costs with examples
a. What is polymorphism in Java? How does method overriding implement it? [5+5]
7) a) Explain Abstract classes and methods in Java. Compare them with interfaces and provide an example.
a. Explain how Javi packages are created and accessed, and discuss their advantages with examples.
[5+5]
8) a) Define an Interface. Difference between classes and interface.
a. What is polymorphism in Java? How does method. overriding implement it? [5+5]
9. a) What are differences between an interface and class? Explain with suitable example.
b) Explain the concept of streams and about stream classes and classification? [5+5]
[5+5]
12. a) Summarize the Exception Hierarchy in Java and demonstrate how to create
Custom Exception subclasses?
b) Describe thread Synchronization, Thread Priorities, and Daemon threads in Java?
[5+5]
14. a) Write a Java program that demonstrates how certain exception types are not allowed
to be thrown?
b) Compare and contrast process-based multitasking and thread based multitasking?
[5+5]
15. a) Explain in detail about usage of Try Catch and throws
UNIT IV
16 a) What is Event Handling in Java? Explain sources, event classes, and listeners with
examples?
b) How do MouseListener und WindowListener handle events in Java? Provide examples?
[5+5]
UNIT V
21.a) What are applets in Java? How do you create and pass parameters to them?
b) What are Swing components? Implement any three Swing components in Java?
[5+5]
23.a) Explain the Distinguish between Applets and stand alone Applications in Applet life
cycle?
b) Demonstrate Swing components like JButton JCheckBox, JComboBox, JTree, and
JTable?
[5+5]
24. a) What are applets in Java? How do you create and pass parameters to them?
b) Explain the following
a) JScrollpane.
b) Combo boxes.
25. a) What is swing? Discuss its features. list out the limitations of AWT?
b) Discuss model view controller (MVC) architecture?
[5+5]