Question Paper Code : 40920
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2024.
Third/Fourth Semester
Computer Science and Engineering
CS 3391 — OBJECT ORIENTED PROGRAMMING
(Common to : Biomedical Engineering/Computer Science and Design/Computer Science and Engineering (Artificial Intelligence and Machine Learning)/Computer Science and Engineering (Cyber Security)/Computer and Communication Engineering/Medical Electronics/Computer Science and Business Systems/Information Technology)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
How is encapsulation achieved in java?
- 2.
State the type promotion rule in Java.
- 3.
State the two general forms of using super keyword.
- 4.
What is method overloading?
- 5.
Define thread priority.
- 6.
Why is autoboxing used?
- 7.
Write any two forms of PrintStream constructors.
- 8.
State the functionality of BufferedInputStream( ).
- 9.
How CardLayout class is unique among the other Layout managers?
- 10.
What is an Inner class?
PART B — (5 × 13 = 65 marks)
- 11.(a)
Explain in detail about Java's Selection statements with example.
- Or
- (b)
What is a class? Write the general form of a class and explain how to declare an object and add a method to class that takes parameter?
- 12.(a)
Explain about the Dynamic Method Dispatch in Java with example.
- Or
- (b)
Discuss in detail about the methods available in object class.
- 13.(a)
Explain how the exception handling in java is handled.
- Or
- (b)
Discuss in detail about java thread model.
- 14.(a)
Write a Java program that read and write the data from console.
- Or
- (b)
Discuss the four different ways to extract a character from string object.
- 15.(a)
Discuss in detail about the delegation event model approach for event handling.
- Or
- (b)
Explain in detail about the class hierarchy for panel and frame.
PART C — (1 × 15 = 15 marks)
- 16.(a)
Explain the concept of threads in Java. Write a Java program that creates three threads. Each thread should decrement its counter variable for every 10 seconds.
- Or
- (b)
Develop a java application for a simple calculator that performs basic arithmetic operations (addition, subtraction, multiplication and division). How do you handle the 'division by zero' scenario gracefully? Include your suggestion in the implementation.