JNTU

JNTU B.Tech II JAVA PROGRAMMING Previous Question Paper (March - 2022 - R13)

B.Tech | II | II-II | R13 | March - 2022

Answer PaperPaper Code: 114CXMaximum Marks: 75Time: 3 Hours

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

What are the drawbacks of procedural languages? Explain the need of object-oriented programming with suitable program.

8 marks

Answer

Procedural programming languages focus on a step-by-step execution of functions, which leads to several drawbacks: data is often global and easily accessible, making it vulnerable to accidental modification; code reusability is limited because functions are tightly coupled to data structures; and maintaining or scaling large, complex systems becomes difficult as the code becomes monolithic and hard to debug.

Object-oriented programming (OOP) addresses these issues by bundling data and methods into objects, promoting encapsulation, inheritance, and polymorphism. This improves modularity, security, and maintainability.

Example in Java:

class Calculator { private int result; public void add(int a, int b) { result = a + b; } public int getResult() { return result; } } public class Main { public static void main(String[] args) { Calculator calc = new Calculator(); calc.add(10, 20); System.out.println(calc.getResult()); } }
b

Does Java support multi way selection statement? Justify your answer.

7 marks

Answer

Yes, Java supports multi-way selection through the switch statement. This construct allows a program to evaluate an expression and branch to one of several execution paths based on matching constant values.

The syntax is as follows:

switch(expression) { case value1: // code; break; case value2: // code; break; default: // code; }

The switch statement is more efficient than a long chain of if-else-if statements when checking a single variable against multiple discrete values. Since Java 7, the expression can also be of type String, providing greater flexibility in control flow logic.

215 marks
a

What are the primitive data types in Java? Write about type conversions.

8 marks

Answer

Sign in to view the complete answer paper.

b

What is a constructor? What is its requirement in programming? Explain with program.

7 marks

Answer

Sign in to view the complete answer paper.

3

What are the benefits of inheritance? Explain the various forms of inheritance with suitable code segments.

15 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

How to define a package? How to access, import a package? Explain with examples.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain method overriding with a suitable example program.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

With a program, illustrate user defined exception handling.

8 marks

Answer

Sign in to view the complete answer paper.

b

How to handle multiple catch blocks for a nested try block? Explain with an example.

7 marks

Answer

Sign in to view the complete answer paper.

6

Describe the need of thread synchronization. How is it achieved in Java programming? Explain with a suitable program.

15 marks

Answer

Sign in to view the complete answer paper.

7

Write a JDBC program to search for an attribute in a table and display the entire tuple to the user. For example, display all the details of the student given his/her roll number.

15 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

What is the role of event listeners in event handling? List the Java event listeners.

8 marks

Answer

Sign in to view the complete answer paper.

b

Design a user interface to collect data from the student for admission application using swing components.

7 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 JNTU for B.Tech IT II II-II, March - 2022, R13.

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

Other papers in JAVA PROGRAMMING

Loading Question Papers

Fetching data from database...