JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech II Year OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (April/May - 2018 - R16)

B.Tech | II Year | I Semester | R16 | April/May - 2018

Answer PaperPaper Code: 133BMMaximum Marks: 75Time: 3 Hours

Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit. Each question carries 10 marks and may have a, b, c as sub questions.

Part A

1.a

What is abstract class? Give example.

2 marks

Answer

An abstract class is a class declared with the abstract keyword that cannot be instantiated. It is designed to be a base class for subclasses and may contain a mix of abstract methods (methods without a body) and concrete methods (methods with implementation). Any class extending an abstract class must provide implementations for all its abstract methods, unless the subclass itself is also declared abstract.

Example:

abstract class Animal {
    abstract void makeSound();
    void sleep() {
        System.out.println("Sleeping...");
    }
}

class Dog extends Animal {
    void makeSound() {
        System.out.println("Bark");
    }
}
1.b

Explain the use of ‘for’ statement in Java with an example.

3 marks

Answer

The for statement in Java is a control flow construct used for iterative execution of a block of code. It is most effective when the number of iterations is known in advance. The syntax consists of three parts: initialization, condition, and update.

for (initialization; condition; update) { // code to execute }

The initialization sets the starting point, the condition is checked before each iteration, and the update modifies the loop variable after each cycle. The following example prints the numbers 1 through 5:

for (int i = 1; i <= 5; i++) { System.out.println(i); }
1.c

Define a Package? What is its use in java? Explain.

2 marks

Answer

Sign in to view the complete answer paper.

1.d

List out the benefits of Stream oriented I/O.

3 marks

Answer

Sign in to view the complete answer paper.

1.e

How do we start and stop a thread?

2 marks

Answer

Sign in to view the complete answer paper.

1.f

Write the complete life cycle of a thread.

3 marks

Answer

Sign in to view the complete answer paper.

1.g

What is the benefit of Generics in Collections Framework?

2 marks

Answer

Sign in to view the complete answer paper.

1.h

Differentiate between Enumeration and Iterator interface.

3 marks

Answer

Sign in to view the complete answer paper.

1.i

What are the limitations of AWT?

2 marks

Answer

Sign in to view the complete answer paper.

1.j

Why do applet classes need to be declared as public?

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

What is inheritance and how does it help to create new classes quickly.

5 marks

Answer

Sign in to view the complete answer paper.

b

Describe different levels of access protection available in Java.

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

List the primitive data types available in Java and explain.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is polymorphism? Explain different types of polymorphisms with examples.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

What is an interface? What are the similarities between interfaces and classes?

5 marks

Answer

Sign in to view the complete answer paper.

b

How can you extend one interface by the other interface? Discuss.

5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

Discuss about CLASSPATH environment variables.

5 marks

Answer

Sign in to view the complete answer paper.

b

Discuss the different levels of access protection available in Java.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

What are advantages of using Exception handling mechanism in a program?

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program that demonstrates how certain exception types are not allowed to be thrown.

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

What are the different ways that are possible to create multiple threaded programs in java? Discuss the differences between them.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to create four threads using Runnable interface.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

What is Java Collections Framework? List out some benefits of Collections framework and explain.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is the importance of hashCode() and equals() methods?

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

What are the common algorithms implemented in Collections Framework? Discuss.

5 marks

Answer

Sign in to view the complete answer paper.

b

What is difference between ArrayList and LinkedList in collection framework? Explain.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

What is an applet? Explain the life cycle of Applet with a neat sketch.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write the applets to draw the Cube and Cylinder shapes.

5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a

What is an Layout manager? Explain different types of Layout managers.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to create a frame window that responds to key strokes.

5 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 JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for B.Tech IT II Year I Semester, April/May - 2018, 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...