JNTU
JNTU B.Tech II JAVA PROGRAMMING Previous Question Paper (September/October - 2023 - R15)
Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, Answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.
Part A
What is Byte code?
Answer
Bytecode is the intermediate, platform-independent representation of Java source code generated by the Java compiler (javac). It is a highly optimized set of instructions designed to be executed by the Java Virtual Machine (JVM) rather than directly by the computer's processor, enabling the 'write once, run anywhere' capability of Java.
What is the purpose of ‘this’ keyword in java?
Answer
The this keyword in Java is a reference variable that refers to the current object instance within a method or constructor. Its primary purposes are as follows:
- Resolving Shadowing: It is used to distinguish between class instance variables and parameters when they share the same name, typically in constructors or setter methods (e.g., this.x = x).
- Constructor Chaining: It allows a constructor to call another constructor within the same class using this(), which must be the first statement in the constructor body.
- Passing Current Instance: It can be used to pass the current object as an argument to another method or constructor.
- Returning Current Instance: It can be returned from a method to support method chaining (fluent interface design).
What is an Inner class?
Answer
Sign in to view the complete answer paper.
Define Abstract class and Abstract method.
Answer
Sign in to view the complete answer paper.
What are the two ways of implementing thread in Java?
Answer
Sign in to view the complete answer paper.
Compare and contrast throw and throws.
Answer
Sign in to view the complete answer paper.
What are the advantages of Collections Framework?
Answer
Sign in to view the complete answer paper.
What is JDBC? List the JDBC components?
Answer
Sign in to view the complete answer paper.
Define Adapter classes.
Answer
Sign in to view the complete answer paper.
What is an Event Listener in java?
Answer
Sign in to view the complete answer paper.
Part B
Explain any five features of object oriented programming.
Answer
Sign in to view the complete answer paper.
Write a Program to illustrate static variables and static methods.
Answer
Sign in to view the complete answer paper.
What is garbage collection in Java? How it is achieved?
Answer
Sign in to view the complete answer paper.
Write a Java program to implement constructor overloading.
Answer
Sign in to view the complete answer paper.
What is Method overriding? Write a program to demonstrate method overriding.
Answer
Sign in to view the complete answer paper.
What is a Package? Write down the steps for creating user defined package.
Answer
Sign in to view the complete answer paper.
Explain how interface is used to achieve multiple inheritance in Java?
Answer
Sign in to view the complete answer paper.
What is an exception? Write a program to accept a password from user and throw “Authentication Denied” exception if the password is incorrect.
Answer
Sign in to view the complete answer paper.
Explain with a neat diagram the life cycle of a thread.
Answer
Sign in to view the complete answer paper.
Differentiate between an error and an exception. Give examples for the same.
Answer
Sign in to view the complete answer paper.
Explain JDBC type 1 to type 4 drivers.
Answer
Sign in to view the complete answer paper.
What is a stream? Explain Byte Stream and Character Stream.
Answer
Sign in to view the complete answer paper.
What is the use of ArrayList class? Describe any two methods of Array List class.
Answer
Sign in to view the complete answer paper.
Write a java Program to handle various keyboard events.
Answer
Sign in to view the complete answer paper.
Explain the lifecycle of an applet.
Answer
Sign in to view the complete answer paper.
Compare and contrast Swing and Abstract Window Toolkit (AWT) in Java.
Answer
Sign in to view the complete answer paper.
Briefly explain Delegation Event Model.
Answer
Sign in to view the complete answer paper.