JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech III OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (February/March - 2022 - R18)

B.Tech | III | II | R18 | February/March - 2022

Answer PaperPaper Code: 156CCMaximum Marks: 75Time: 3 hours

Answer any five questions

All questions carry equal marks

Main

115 marks
a

What is method overloading? Define two methods that have same name but different parameter types. Define two methods in class that have identical method names and parameter profile with different return value types or different modifier.

8 marks

Answer

Method overloading is a feature in Java that allows a class to have multiple methods with the same name, provided their parameter lists (number, type, or order of arguments) are different. This is a form of compile-time polymorphism.

Example of overloading with different parameter types:

void display(int a) { ... }
void display(String s) { ... }

Regarding the second part of the query, Java does not support overloading based solely on return type or modifiers. If two methods have the same name and identical parameter profiles, the compiler will throw a compilation error, regardless of whether the return types or access modifiers (like public or private) differ. The method signature in Java is defined strictly by the method name and the parameter list; therefore, the return type is not part of the signature.

b

What is an array? Write a program that creates and initializes a four integer elements array. Find the sum and average of its value.

7 marks

Answer

An array is a container object that holds a fixed number of values of a single data type. Once created, the length of an array is established and cannot be changed.

The following program initializes an array of four integers and calculates their sum and average:

public class ArraySum {
public static void main(String[] args) {
int[] numbers = {10, 20, 30, 40};
int sum = 0;
for (int i = 0; i < numbers.length; i++) {
sum += numbers[i];
}
double average = (double) sum / numbers.length;
System.out.println("Sum: " + sum);
System.out.println("Average: " + average);
}
}
215 marks
a

Write a program to find the inverse of a given matrix.

6 marks

Answer

Sign in to view the complete answer paper.

b

What is constructor? Explain the types of constructors are used in Java.

9 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Explain the process of defining and creating a package with suitable examples.

8 marks

Answer

Sign in to view the complete answer paper.

b

Define an interface in java. How are interfaces implemented? How they can be accessed?

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Explain the types of Access specifiers are used in Java and also illustrate with an example.

7 marks

Answer

Sign in to view the complete answer paper.

b

What is the use of super and final?

8 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

What is an Exception? List out the keywords for exception handling and write steps to develop user defined exception.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a program that counts number of characters, words, and lines in a file. Use exceptions to check whether the file that is read exists or not.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

What is multithreading? What are the priorities given for multithreading? Explain advantages of multithreading.

8 marks

Answer

Sign in to view the complete answer paper.

b

Describe the complete life cycle of a thread with an example.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

Write short notes on event, event source and event listeners.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about layout manager and different layouts and write an example program to demonstrate layouts.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

How to create an applet? Explain with an example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain MVC Architecture in detail.

7 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 EIE III II, February/March - 2022, R18.

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