JNTU
JNTU B.Tech II OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (August/September - 2022 - R16)
Answer any five questions. All questions carry equal marks.
Main
What are object-oriented paradigms? Explain in detail.
Answer
Object-oriented programming (OOP) is a paradigm based on the concept of objects, which contain data in the form of fields (attributes) and code in the form of procedures (methods). It aims to increase the modularity and reusability of software by organizing code into classes.
The fundamental pillars of OOP are:
- Encapsulation: The bundling of data and the methods that operate on that data into a single unit (class), while restricting direct access to some of an object's components to protect the internal state.
- Abstraction: The process of hiding complex implementation details and showing only the essential features of an object, reducing programming complexity.
- Inheritance: A mechanism where one class (subclass) acquires the properties and behaviors of another class (superclass), promoting code reusability.
- Polymorphism: The ability of an object or method to take on multiple forms. It is implemented through method overloading (compile-time) and method overriding (runtime).
Explain about various data types used in Java with examples.
Answer
Java is a statically-typed language, meaning all variables must be declared before use. Data types are categorized into two groups:
1. Primitive Data Types: These are the basic building blocks of data, predefined by the language.
- byte: 8-bit signed integer (e.g., byte b = 10;).
- short: 16-bit signed integer (e.g., short s = 100;).
- int: 32-bit signed integer (e.g., int i = 1000;).
- long: 64-bit signed integer (e.g., long l = 100000L;).
- float: 32-bit IEEE 754 floating point (e.g., float f = 10.5f;).
- double: 64-bit IEEE 754 floating point (e.g., double d = 20.99;).
- char: 16-bit Unicode character (e.g., char c = 'A';).
- boolean: Represents true or false values (e.g., boolean flag = true;).
2. Non-Primitive (Reference) Data Types: These refer to objects and are not stored directly in the variable but hold a reference to the memory location. Examples include Strings, Arrays, and Classes (e.g., String str = "Hello";).
Discuss about various types of polymorphism.
Answer
Sign in to view the complete answer paper.
What are Java buzzwords? Explain in detail.
Answer
Sign in to view the complete answer paper.
Explain about importing Java packages with suitable Java program.
Answer
Sign in to view the complete answer paper.
Write a program to improve the efficiency of writing data into a file using Buffered Output Stream.
Answer
Sign in to view the complete answer paper.
Discuss about input and output streams in Java with examples.
Answer
Sign in to view the complete answer paper.
Explain about implementation of interfaces in Java.
Answer
Sign in to view the complete answer paper.
What is an exception? Explain about exceptional handling in Java.
Answer
Sign in to view the complete answer paper.
Explain about creation of threads in Java.
Answer
Sign in to view the complete answer paper.
Discuss about creating user defined exceptions in detail.
Answer
Sign in to view the complete answer paper.
Differentiate between thread-based multitasking and process-based multitasking.
Answer
Sign in to view the complete answer paper.
Define HashMap. Write a program that shows the use of HashMap class.
Answer
Sign in to view the complete answer paper.
Explain about Calendar class and DateFormat class methods in detail.
Answer
Sign in to view the complete answer paper.
Explain the following:
MVC architecture
Answer
Sign in to view the complete answer paper.
Anonymous inner classes
Answer
Sign in to view the complete answer paper.
Security issues in applets.
Answer
Sign in to view the complete answer paper.