JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD B.Tech II Year OBJECT ORIENTED PROGRAMMING THROUGH JAVA Previous Question Paper (March - 2021 - R16)
Answer any five questions
All questions carry equal marks
Main
Explain various features of Java language.
Answer
Java is a robust, object-oriented language designed for portability and security. Its key features include:
- Simple: Java eliminates complex features like explicit pointers and operator overloading, making it easier to learn and maintain.
- Object-Oriented: Everything in Java is an object, following principles like encapsulation, inheritance, polymorphism, and abstraction.
- Platform Independent: Java code is compiled into bytecode, which runs on any machine equipped with a Java Virtual Machine (JVM), adhering to the 'Write Once, Run Anywhere' (WORA) principle.
- Secure: Java provides a secure environment by avoiding explicit memory management and using a sandbox model for executing untrusted code.
- Robust: It emphasizes early error checking through strong type-checking and provides an effective exception handling mechanism.
- Multithreaded: Java supports concurrent execution of multiple threads, allowing developers to build interactive and responsive applications.
- Distributed: It facilitates the development of applications that can span across multiple machines over a network using RMI and EJB.
Describe various forms of inheritance in java with example.
Answer
Inheritance allows a class to acquire the properties and behaviors of another. Java supports the following forms:
- Single Inheritance: A subclass inherits from one superclass.
Example: class B extends A {} - Multilevel Inheritance: A class inherits from a derived class, creating a chain.
Example: class C extends B {} where B extends A. - Hierarchical Inheritance: Multiple subclasses inherit from a single superclass.
Example: class B extends A {} and class C extends A {}. - Multiple Inheritance (via Interfaces): Java does not support multiple inheritance with classes to avoid ambiguity (the Diamond Problem), but it achieves this through interfaces.
Example: class C implements A, B {}.
Note: Hybrid inheritance, a combination of the above, is also supported in Java only through the use of interfaces.
Explain string and string buffer class in Java.
Answer
Sign in to view the complete answer paper.
Explain about method overriding in Java with example.
Answer
Sign in to view the complete answer paper.
What is interface? How to implement interface in Java?
Answer
Sign in to view the complete answer paper.
Write java program to display the contents of file.
Answer
Sign in to view the complete answer paper.
What is Exception? How exceptions are handled in Java?
Answer
Sign in to view the complete answer paper.
Explain how to implement thread priorities in java with examples.
Answer
Sign in to view the complete answer paper.
Explain briefly about the life cycle of a thread and Explain various methods of thread class.
Answer
Sign in to view the complete answer paper.
What is synchronization? How to implement synchronization in Java.
Answer
Sign in to view the complete answer paper.
Explain about Collection interface and its methods.
Answer
Sign in to view the complete answer paper.
How to implement Array List in Java with examples?
Answer
Sign in to view the complete answer paper.
Write a Java program for method overloading concept.
Answer
Sign in to view the complete answer paper.
Explain about MVC architecture.
Answer
Sign in to view the complete answer paper.
Develop an applet that receives an integer in one text filed and the compute the factorial value and return in another text filed, when the button named COMPUTE is clicked.
Answer
Sign in to view the complete answer paper.
Explain about the Mouse Event Class and how to implement java with example.
Answer
Sign in to view the complete answer paper.