JNTU

JNTU MCA 2022 JAVA PROGRAMMING Previous Question Paper (September/October - 2022 - R15)

MCA | 2022 | III | R15 | September/October - 2022

Answer PaperPaper Code: 813AQMaximum Marks: 60Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

112 marks
a

What is autoboxing and autounboxing? Give examples.

6 marks

Answer

Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes (e.g., converting an int to an Integer). This occurs when a primitive value is passed as a parameter to a method that expects an object or assigned to a variable of the wrapper class type.

Autounboxing is the reverse process, where the Java compiler automatically converts an object of a wrapper type back into its corresponding primitive type (e.g., converting an Integer back to an int). This occurs when an object is assigned to a primitive variable or used in an expression requiring a primitive.

// Autoboxing example
Integer obj = 10; // Compiler treats this as Integer.valueOf(10)

// Autounboxing example
int val = obj; // Compiler treats this as obj.intValue()
b

Discuss about garbage collection.

6 marks

Answer

Garbage collection is the process by which the Java Virtual Machine (JVM) automatically manages memory by reclaiming memory occupied by objects that are no longer reachable by the application. This mechanism eliminates the need for manual memory deallocation, thereby reducing memory leaks and dangling pointer errors.

  • Eligibility: An object becomes eligible for garbage collection when it is no longer reachable from any live thread or static reference.
  • Process: The Garbage Collector (GC) runs as a daemon thread in the background. It identifies unreachable objects and marks them for deletion.
  • Triggering: While the JVM decides when to run the GC, a programmer can suggest it by calling System.gc(), though this does not guarantee immediate execution.
  • Finalization: Before reclaiming memory, the GC calls the finalize() method of the object, providing a final opportunity for the object to perform cleanup tasks.
212 marks
a

Explain break and continue statements with examples.

6 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about overloading methods.

6 marks

Answer

Sign in to view the complete answer paper.

3

What is inner class? What are local, static and anonymous inner classes?

12 marks

Answer

Sign in to view the complete answer paper.

412 marks
a

What is a package? How are they imported? What are its advantages?

6 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about preventing inheritance.

6 marks

Answer

Sign in to view the complete answer paper.

5

Explain Set and List collection interfaces.

12 marks

Answer

Sign in to view the complete answer paper.

6

Explain Iterator interface and ListIterator interface.

12 marks

Answer

Sign in to view the complete answer paper.

7

What is a thread? How does it differ from a process? What are thread priorities? How do you set thread priorities?

12 marks

Answer

Sign in to view the complete answer paper.

8

Explain JTextField and JTextArea in detail.

12 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of JAVA PROGRAMMING from JNTU for MCA 2022 III, September/October - 2022, R15.

For the question paper without answers, switch to the Question Paper tab.

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...