JNTU

JNTU B.Tech II OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (October - 2020 - R16)

B.Tech | II | I | R16 | October - 2020

Answer PaperPaper Code: 133BMMaximum Marks: 75Time: 2 hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

What are the primitive data types available in Java? Explain.

7 marks

Answer

Java provides eight primitive data types, which are the basic building blocks for data manipulation. These are categorized as follows:

  • byte: 8-bit signed integer, range -128 to 127.
  • short: 16-bit signed integer, range -32,768 to 32,767.
  • int: 32-bit signed integer, the default choice for integer values.
  • long: 64-bit signed integer, used when a wider range than int is required.
  • float: 32-bit IEEE 754 floating-point, used for decimal values requiring less precision.
  • double: 64-bit IEEE 754 floating-point, the default choice for decimal values.
  • char: 16-bit Unicode character, range '\u0000' to '\uffff'.
  • boolean: Represents one bit of information, having only two possible values: true or false.
b

What is composition in Java? How is it different from inheritance?

8 marks

Answer

Composition is a design technique in Java where a class contains an instance of another class as a member variable. It represents a 'has-a' relationship, implying that the contained object is part of the container object.

The primary differences between composition and inheritance are:

FeatureCompositionInheritance
RelationshipHas-aIs-a
CouplingLow coupling; objects are independent.High coupling; child depends on parent.
FlexibilityHighly flexible; components can be changed at runtime.Less flexible; hierarchy is fixed at compile time.
AccessAccesses features via object reference.Inherits members directly from the superclass.

Composition is generally preferred over inheritance to achieve code reuse because it allows for greater encapsulation and avoids the rigid constraints of deep inheritance hierarchies.

215 marks
a

Write a detailed note on Java Virtual Machine.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is meant by data abstraction? Briefly explain.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Discuss the similarities between interfaces and classes.

8 marks

Answer

Sign in to view the complete answer paper.

b

How to design and implement an interface? Explain.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Write a Java program to show the use of File Input Stream.

8 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about File Output Stream with an example.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

What is an Exception? How is an Exception handled in JAVA? Give example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Distinguish between thread based and process based multitasking.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain the thread based preemptive multitasking with example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write about built-in exceptions in java.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Give overview of collections framework.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain Date and Scanner classes in detail.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain the process of passing parameters to Applets.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to implement the keyboard events in Java.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of OBJECT ORIENTED PROGRAMMING THROUGH JAVA from JNTU for B.Tech CSE II I, October - 2020, R16.

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

Other papers in OBJECT ORIENTED PROGRAMMING THROUGH JAVA

Loading Question Papers

Fetching data from database...