JNTU

JNTU B.Tech IV JAVA PROGRAMMING Previous Question Paper (February/March-2022 - R18)

B.Tech | IV | IV-I | R18 | February/March-2022

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

Answer any Five Questions

All Questions Carry Equal Marks

Main

115 marks
a

Explain the features of object oriented programming.

7 marks

Answer

Object-Oriented Programming (OOP) is a paradigm based on the concept of objects, which contain data and code. Its primary features include:

  • Classes and Objects: A class is a blueprint for creating objects, while an object is an instance of a class that encapsulates state and behavior.
  • Encapsulation: The bundling of data (variables) and methods that operate on the data into a single unit, restricting direct access to some components to protect internal state.
  • Abstraction: Hiding complex implementation details and showing only the necessary features of an object to the user.
  • Inheritance: A mechanism where a new class derives properties and behaviors from an existing class, promoting code reusability.
  • Polymorphism: The ability of an object or method to take on multiple forms, typically achieved through method overloading (compile-time) and method overriding (runtime).
b

Write an example program to describe the concept of constructors.

8 marks

Answer

A constructor is a special member method that is invoked automatically when an object of a class is created. It has the same name as the class and no return type.

class Student {
    String name;
    int id;

    // Default Constructor
    Student() {
        name = "Unknown";
        id = 0;
    }

    // Parameterized Constructor
    Student(String n, int i) {
        name = n;
        id = i;
    }

    void display() {
        System.out.println("Name: " + name + ", ID: " + id);
    }
}

public class Main {
    public static void main(String[] args) {
        Student s1 = new Student();
        Student s2 = new Student("Alice", 101);
        s1.display();
        s2.display();
    }
}
215 marks
a

Compare procedural languages with object oriented languages.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program that implements binary search operation.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Describe the usage of super keyword with suitable program segments.

8 marks

Answer

Sign in to view the complete answer paper.

b

Can inheritance be applicable to interfaces? Justify your answer with suitable java program.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

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

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program to implement multilevel inheritance.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Define thread. Explain how threads can be created by extending Thread class.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a java program to implement producer-consumer problem using the concept of inter thread communication.

8 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

List and explain the different built in exceptions with examples for each.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain the concept of exceptions in java with example.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What are events in java? Write a program for keyboard event.

7 marks

Answer

Sign in to view the complete answer paper.

b

Discuss about the significance of GridLayout manager in java using an example.

8 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Explain different stages in the life cycle of an applet.

8 marks

Answer

Sign in to view the complete answer paper.

b

Why Multithreading is used? Explain briefly about Multithreading with an example.

7 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 ME IV IV-I, February/March-2022, 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...