JNTU

JNTU B.Tech II JAVA PROGRAMMING Previous Question Paper (August/September - 2022 - R13)

B.Tech | II | II | R13 | August/September - 2022

Answer PaperPaper Code: 114CXMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Explain Data abstraction, encapsulation and inheritance with suitable example.

8 marks

Answer

Data Abstraction is the process of hiding implementation details and showing only the essential features of an object. In Java, this is achieved using abstract classes and interfaces. For example, a Shape abstract class defines a method draw(), while specific subclasses like Circle or Rectangle provide the actual implementation.

Encapsulation is the mechanism of wrapping data (variables) and code (methods) together as a single unit. It is achieved by declaring class variables as private and providing public getter and setter methods to access them, ensuring data security. For example, a Student class with a private rollNumber field accessed via getRollNumber().

Inheritance is a mechanism where a new class acquires the properties and behaviors of an existing class. It promotes code reusability. For example, a Manager class can extend an Employee class to inherit common attributes like name and id, while adding specific attributes like department.

b

Discuss different data types defined in Java.

7 marks

Answer

Java defines two main categories of data types: Primitive and Non-Primitive.

Primitive Data Types are predefined by the language and hold single values:

  • byte: 8-bit signed integer.
  • short: 16-bit signed integer.
  • int: 32-bit signed integer.
  • long: 64-bit signed integer.
  • float: 32-bit single-precision floating-point.
  • double: 64-bit double-precision floating-point.
  • char: 16-bit Unicode character.
  • boolean: Represents true or false.

Non-Primitive Data Types (or Reference Types) refer to objects and include Classes, Interfaces, and Arrays. These store memory addresses of objects rather than the actual data values.

2

Explain the following with example:

15 marks
a

this keyword.

5 marks

Answer

Sign in to view the complete answer paper.

b

garbage collection.

5 marks

Answer

Sign in to view the complete answer paper.

c

Constructor.

5 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

What is inheritance? Discuss different inheritance types.

6 marks

Answer

Sign in to view the complete answer paper.

b

Does java support multiple inheritances? Justify your answer.

3 marks

Answer

Sign in to view the complete answer paper.

c

Discuss member access rules.

6 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

What is inner class? Discuss different inner classes.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is a package? Explain creating and accessing package with example.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain checked exceptions and unchecked exceptions with example.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain the usage of try, catch, throw, throws and finally keywords in exception.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain different procedures for creating thread.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain thread states and thread priorities.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Explain different java collections in brief.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a Java program to copy contents of one file to another.

5 marks

Answer

Sign in to view the complete answer paper.

c

What is JDBC? Explain different JDBC drivers.

5 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain AWT class hierarchy.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is an Applet? Explain the life cycle of an Applet.

5 marks

Answer

Sign in to view the complete answer paper.

c

Write a java program to pass parameters to an Applet.

5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of JAVA PROGRAMMING from JNTU for B.Tech CSE II II, August/September - 2022, R13.

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

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...