JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA JAVA PROGRAMMING Previous Question Paper (May - 2022 - R20)

MCA | II | R20 | May - 2022

Answer PaperPaper Code: 872AAMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Illustrate the use of this keyword with an example.

7 marks

Answer

The this keyword in Java is a reference variable that refers to the current object instance. It is primarily used to resolve ambiguity between instance variables and parameters with the same name, or to invoke other constructors within the same class.

Example:

class Student {
    String name;
    Student(String name) {
        this.name = name; // Resolves ambiguity between parameter and field
    }
}

Key uses include:

  • Referencing the current class instance variable.
  • Invoking current class constructor using
    this()
    .
  • Passing the current object as a parameter to another method.
  • Returning the current class instance from a method.
b

Differentiate between procedural language and OOP.

8 marks

Answer

Procedural programming focuses on a step-by-step execution of functions or procedures, whereas Object-Oriented Programming (OOP) focuses on objects that encapsulate both data and behavior.

FeatureProcedural LanguageOOP
ApproachTop-downBottom-up
Data SecurityData is exposed to the entire programData is hidden via encapsulation
FocusFunctions and logicObjects and data
Code ReusabilityLimited (via function calls)High (via inheritance and polymorphism)
ComplexityDifficult to manage for large systemsEasier to manage via modularity

In procedural languages like C, the program is divided into functions, and data moves freely between them. In OOP languages like Java, the program is organized into objects, which are instances of classes. This allows for features like inheritance, where new classes can derive properties from existing ones, and polymorphism, which allows objects to be treated as instances of their parent class, significantly improving maintainability and scalability.

215 marks
a

What is the main purpose of Constructor? How to invoke a constructor in JAVA?

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program to illustrate the usage of conditional statements.

7 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Explain the creation of packages and accessing a package with sample program.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write the importance of abstract classes.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Illustrate the use of super and final key words in java.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain the benefits of inheritance.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain nested try and final statements in exceptional handling.

7 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate the definition and implementation of interface in java.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Distinguish between checked and unchecked exceptions.

7 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate Java program for array index out of bound and divide by zero exception.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Explain the following Layout Managers: i) border layout ii) grid bag layout

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a short note on following: i) JFrame ii) Scroll Panes.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain the life cycle of an applet.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write the differences between multi-threading and multitasking.

8 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 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for MCA II, May - 2022, R20.

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

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...