JNTU

JNTU B.Tech III OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (November/December - 2020 - R15)

B.Tech | III | III-II | R15 | November/December - 2020

Answer PaperPaper Code: 126ZYMaximum Marks: 75Time: 2 hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Discuss the overloading and overriding concepts in OOP.

7 marks

Answer

Method Overloading occurs when multiple methods in the same class share the same name but have different parameter lists (different number, type, or order of arguments). It is a form of compile-time polymorphism, as the compiler determines which method to invoke based on the method signature at compile time. It improves code readability and allows methods to perform similar tasks with different input types.

Method Overriding occurs when a subclass provides a specific implementation for a method that is already defined in its superclass. The method signature must be identical. It is a form of run-time polymorphism (dynamic method dispatch), where the JVM determines which method to execute based on the actual object type at runtime. It is a fundamental aspect of inheritance, allowing for specialized behavior in subclasses.

b

Write about garbage collection and the finalize method in Java.

8 marks

Answer

Garbage Collection is the automatic process by which the Java Virtual Machine (JVM) manages memory by reclaiming memory occupied by objects that are no longer reachable by the application. This eliminates the need for manual memory deallocation, reducing memory leaks and dangling pointer issues. The garbage collector identifies unreachable objects—those that no longer have any active references—and marks them for deletion.

The finalize() method is a protected method defined in the Object class that the garbage collector calls on an object before reclaiming its memory. It is intended for performing cleanup tasks, such as closing file handles or releasing native resources. However, relying on finalize() is discouraged because it is not guaranteed to be called promptly, and its execution timing is non-deterministic. Modern Java development prefers using try-with-resources blocks or the AutoCloseable interface for resource management instead.

2

What do you mean by inheritance? Explain how inheritance can be achieved in Java. Give examples.

15 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

How does java’s multithreading capability enable you to write more efficient programs? Explain.

7 marks

Answer

Sign in to view the complete answer paper.

b

List and explain the benefits of Exception Handling.

8 marks

Answer

Sign in to view the complete answer paper.

4

Define Event. Explain about Adapter classes with example.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Write a program to create a form for login page using swing components.

8 marks

Answer

Sign in to view the complete answer paper.

b

How would you detect a key press in a JComboBox? Explain.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Define scope and lifetime of variables. Explain about the scope and lifetime of variables in Java.

8 marks

Answer

Sign in to view the complete answer paper.

b

Differentiate between the prefix and postfix forms of the increment operator. Give examples for each.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

How to create a package in java? Give example code.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program to illustrate abstract classes.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain the effect of adding synchronized keyword to a method.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain thread priorities.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of OBJECT ORIENTED PROGRAMMING THROUGH JAVA from JNTU for B.Tech EIE III III-II, November/December - 2020, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in OBJECT ORIENTED PROGRAMMING THROUGH JAVA

Loading Question Papers

Fetching data from database...