JNTU

JNTU B.Tech IV Year JAVA PROGRAMMING Previous Question Paper (January/February - 2023 - R18)

B.Tech | IV Year | I Semester | R18 | January/February - 2023

Answer PaperPaper Code: 157EUMaximum Marks: 75Time: 3 Hours

Part A is compulsory (25 Marks). Answer all questions. In Part B, answer any one question from each unit (50 Marks). Each question in Part B carries 10 marks.

Part A

1a

Differentiate between class and object.

2 marks

Answer

A class is a user-defined blueprint or template that defines the properties (fields) and behaviors (methods) common to all objects of a certain type; it does not occupy memory when defined. An object is an instance of a class that represents a real-world entity, created at runtime using the new keyword, and it occupies memory to store its specific state.

1b

What is recursion? Give example?

3 marks

Answer

Recursion is a programming technique where a method calls itself to solve a problem by breaking it down into smaller, self-similar sub-problems. Every recursive method must have a base case to terminate the execution and a recursive step that moves the state closer to the base case to avoid infinite loops.

Example: Calculating the factorial of a number.

public int factorial(int n) {
    if (n == 0 || n == 1) {
        return 1; // Base case
    }
    return n * factorial(n - 1); // Recursive step
}
1c

What is the importance of base class object?

2 marks

Answer

Sign in to view the complete answer paper.

1d

Mention the significance of CLASSPATH environmental variable in packages.

3 marks

Answer

Sign in to view the complete answer paper.

1e

Differentiate between throw and throws keywords.

2 marks

Answer

Sign in to view the complete answer paper.

1f

Distinguish among String, StringBuffer, and StringBuilder classes.

3 marks

Answer

Sign in to view the complete answer paper.

1g

What is the range of values for thread priority and what is its significance?

2 marks

Answer

Sign in to view the complete answer paper.

1h

What is event source? Give examples of event sources?

3 marks

Answer

Sign in to view the complete answer paper.

1i

Compare and contrast between application and applet.

2 marks

Answer

Sign in to view the complete answer paper.

1j

Discuss the sequence of methods called while destroying an applet.

3 marks

Answer

Sign in to view the complete answer paper.

Part B

210 marks
a

Demonstrate nested class with a program.

5 marks

Answer

Sign in to view the complete answer paper.

b

Develop a program that shows the binary equivalent of a given positive number from 0 to 255?

5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a

Develop a Java Program to make frequency count of words in a given text.

5 marks

Answer

Sign in to view the complete answer paper.

b

Explain parameter passing to functions in Java.

5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a

What are the uses of super keyword, describe?

5 marks

Answer

Sign in to view the complete answer paper.

b

Design a class that implements an interface that extends from another interface.

5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a

Why do we need packages? How to create and import packages?

5 marks

Answer

Sign in to view the complete answer paper.

b

Describe final class in inheritance.

5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a

Describe the various string comparison methods.

5 marks

Answer

Sign in to view the complete answer paper.

b

Elaborate on collection interfaces in java.uitl package.

5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a

Describe the constructors of String class.

5 marks

Answer

Sign in to view the complete answer paper.

b

Write a program to catch Negative Array Size Exception. This exception is caused when the array size is initialized to negative values.

5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a

Describe any four Event Classes with its constructors in java.awt.event.

5 marks

Answer

Sign in to view the complete answer paper.

b

Develop GUI application using lists that allow multiple selections and add action listener.

5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a

Mention the commonly used listener interfaces and their implemented adapter classes?

5 marks

Answer

Sign in to view the complete answer paper.

b

Develop a GUI application using canvas.

5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a

What are different states of a thread, explain?

5 marks

Answer

Sign in to view the complete answer paper.

b

Develop an applet that receives an integer in one text field and compute its factorial value in another text field, when the button named ‘Compute” is clicked.

5 marks

Answer

Sign in to view the complete answer paper.

OR
11

What is thread synchronization? Demonstrate the different ways to synchronize threads with programs.

10 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 EEE IV Year I Semester, January/February - 2023, R18.

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...