Jawaharlal Nehru Technological University Hyderabad

Jawaharlal Nehru Technological University Hyderabad B.Tech III JAVA PROGRAMMING Previous Question Paper (August - 2022 - R16)

B.Tech | III | III-II | R16 | August - 2022

Answer PaperPaper Code: 136FMMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

What is type conversion and casting? Explain with an example.

8 marks

Answer

Type conversion in Java is the process of converting a value from one data type to another. It is categorized into two types: Widening and Narrowing.

Widening Casting (Implicit): This occurs automatically when a smaller data type is converted into a larger data type. It is safe because there is no loss of data.

int myInt = 9; double myDouble = myInt; // Automatic conversion: int to double

Narrowing Casting (Explicit): This must be done manually by placing the target type in parentheses in front of the value. It is necessary when converting a larger data type to a smaller one, which may result in data loss.

double myDouble = 9.78; int myInt = (int) myDouble; // Manual conversion: double to int
b

Write a java program to display all the odd numbers between 1 to 30 using ‘for’ loop and ‘if’ statement.

7 marks

Answer

The following Java program iterates from 1 to 30 and uses an if statement to check for odd numbers by verifying if the remainder is non-zero when divided by 2.

public class OddNumbers {
    public static void main(String[] args) {
        for (int i = 1; i <= 30; i++) {
            if (i % 2 != 0) {
                System.out.print(i + " ");
            }
        }
    }
}
2

Discuss about the method overloading and constructor overloading with an example.

15 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Write a Java program to implement multilevel inheritance concept.

8 marks

Answer

Sign in to view the complete answer paper.

b

Give the differences between an Abstract class and an Interface.

7 marks

Answer

Sign in to view the complete answer paper.

4

Explain the following:

15 marks
a

Final classes and methods

7 marks

Answer

Sign in to view the complete answer paper.

b

Anonymous inner classes.

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

What is an exception? Explain how an exception can be handled in Java? And also list the benefits of Exception Handling.

8 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate nested ‘try’ statements with an example program in Java.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Describe the complete life cycle of a thread.

8 marks

Answer

Sign in to view the complete answer paper.

b

What are the differences between multiprocessing and multithreading? State the advantages of multithreading.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Give an overview of Java collection framework.

7 marks

Answer

Sign in to view the complete answer paper.

b

Demonstrate about stack class with an example.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain the phases in the life cycle of an Applet.

9 marks

Answer

Sign in to view the complete answer paper.

b

Write down the differences between Applets and applications.

6 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 Jawaharlal Nehru Technological University Hyderabad for B.Tech CE III III-II, August - 2022, R16.

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

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...