JNTU

JNTU MCA 2020 JAVA PROGRAMMING Previous Question Paper (October/ November - 2020 - R13)

MCA | 2020 | III | R13 | October/ November - 2020

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

Answer any five questions. All questions carry equal marks.

Main

1

Explain various constructors in java and also explain constructor overloading concept.

12 marks

Answer

A constructor in Java is a special block of code that is called when an instance of an object is created. It has the same name as the class and does not have an explicit return type, not even void. Constructors are primarily used to initialize the state of an object.

There are three main types of constructors:

  1. Default Constructor: If a class does not define any constructor, the Java compiler automatically provides a no-argument default constructor. It initializes instance variables to their default values (e.g., 0 for int, null for objects).
  2. No-Argument Constructor: A constructor explicitly defined by the programmer that accepts no parameters. It is used to provide specific initial values to object attributes upon creation.
  3. Parameterized Constructor: A constructor that accepts arguments. It allows the programmer to pass specific values during object creation to initialize instance variables with custom data.

Constructor Overloading is a technique in Java that allows a class to have multiple constructors with different parameter lists. This is a form of polymorphism. The compiler differentiates between these constructors based on the number, type, and order of the arguments passed.

Example of constructor overloading:

class Student {
String name;
Student() { name = "Unknown"; }
Student(String n) { name = n; }
}

In this example, the class Student is overloaded with a no-argument constructor and a parameterized constructor, providing flexibility in how objects are initialized.

2

Write the features of java and explain them.

12 marks

Answer

Java is a high-level, class-based, object-oriented programming language designed to have as few implementation dependencies as possible. Its primary features are as follows:

  • Simple: Java is designed to be easy to learn and use. It eliminates complex features of C++ such as explicit pointers and operator overloading, and includes automatic garbage collection to manage memory.
  • Object-Oriented: Everything in Java is an object. It follows the principles of object-oriented programming (OOP) such as encapsulation, inheritance, polymorphism, and abstraction, which help in organizing complex software.
  • Platform Independent: Java code is compiled into bytecode, which is executed by the Java Virtual Machine (JVM). This allows the same program to run on any platform that has a JVM installed, adhering to the principle of 'Write Once, Run Anywhere' (WORA).
  • Robust: Java emphasizes early error checking and runtime safety. It provides strong memory management, exception handling, and type checking to minimize the risk of crashes.
  • Secure: Java provides a secure environment by running code inside a sandbox. It lacks explicit pointers and includes a security manager to define access policies, protecting systems from malicious code.
  • Multithreaded: Java has built-in support for multithreading, allowing developers to write programs that perform multiple tasks simultaneously, which is essential for interactive and responsive applications.
  • Distributed: Java is designed for the distributed environment of the internet. It provides extensive libraries for handling TCP/IP protocols, making it easy to access objects across the network.
  • High Performance: Although interpreted, Java achieves high performance through the use of Just-In-Time (JIT) compilers, which compile bytecode into native machine code at runtime.
312 marks
a

What is inheritance? Write its advantages and describe different types of inheritance.

6 marks

Answer

Sign in to view the complete answer paper.

b

How do you implement multilevel inheritance in java, explain with an example.

6 marks

Answer

Sign in to view the complete answer paper.

412 marks
a

Explain about dynamic method dispatch with an example.

6 marks

Answer

Sign in to view the complete answer paper.

b

Explain about local inner class and anonymous inner class.

6 marks

Answer

Sign in to view the complete answer paper.

5

Write a program to create random access file in java and display data in random from the created file.

12 marks

Answer

Sign in to view the complete answer paper.

612 marks
a

Give the overview of any three collection interfaces with examples.

6 marks

Answer

Sign in to view the complete answer paper.

b

Implement stack using linked list with the help of collection classes.

6 marks

Answer

Sign in to view the complete answer paper.

7

Design a java application to handle user defined exception.

12 marks

Answer

Sign in to view the complete answer paper.

8

Explain JCheckBox and JRadioButton classes with example program.

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 2020 III, October/ November - 2020, R13.

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

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...