JNTUH
JNTUH B.Tech III JAVA PROGRAMMING Previous Question Paper (February - 2023 - R16)
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
If all objects of a class need to share the same variable, how must you declare that variable?
Answer
To share a variable among all objects of a class, you must declare it using the static keyword. A static variable belongs to the class itself rather than any individual instance, ensuring only one copy exists in memory.
What is the difference between call-by-value and call-by-reference?
Answer
In call-by-value, a copy of the actual parameter's value is passed to the method; changes made to the parameter inside the method do not affect the original variable. In call-by-reference (or passing object references in Java), the memory address of the object is passed, allowing the method to modify the state of the original object.
How does a subclass constructor execute its superclass’s constructor?
Answer
Sign in to view the complete answer paper.
How many classes can implement an interface? How many interfaces can a class implement?
Answer
Sign in to view the complete answer paper.
What is the purpose of the run( ) method defined by Runnable?
Answer
Sign in to view the complete answer paper.
How do you restrict access to an object to one thread at a time?
Answer
Sign in to view the complete answer paper.
What are the types of JDBC drivers?
Answer
Sign in to view the complete answer paper.
Distinguish between text files and binary files.
Answer
Sign in to view the complete answer paper.
Discuss on hierarchy of swing components.
Answer
Sign in to view the complete answer paper.
Mention the relationship between event sources and event sources and event listeners.
Answer
Sign in to view the complete answer paper.
Part B
What is garbage collection, and how does it work? What is finalize( )?
Answer
Sign in to view the complete answer paper.
Develop a Java program that sorts an array of strings by their lengths (instead of sorting them alphabetically).
Answer
Sign in to view the complete answer paper.
Write a Java program that creates a “triangular” two-dimensional array A of 10 rows. The first row has length 1, the second row has length 2, the third row has length 3, and so on. Then initialize the array using nested for loops so that the value of A[i][j] is i+j. Finally, print out the array in a nice triangular form.
Answer
Sign in to view the complete answer paper.
Mention the operators hierarchy in Java.
Answer
Sign in to view the complete answer paper.
Explain how inheritance, method overriding, and abstract classes are used to support polymorphism.
Answer
Sign in to view the complete answer paper.
Implement queue data structure using interfaces.
Answer
Sign in to view the complete answer paper.
What are anonymous inner class? Give an example program.
Answer
Sign in to view the complete answer paper.
Present a brief note on abstract classes and methods.
Answer
Sign in to view the complete answer paper.
Write a program using the synchronized Statement.
Answer
Sign in to view the complete answer paper.
Illustrate throws keyword with a program.
Answer
Sign in to view the complete answer paper.
Discuss on thread priorities.
Answer
Sign in to view the complete answer paper.
How to create your own exceptions. Illustrate with an example.
Answer
Sign in to view the complete answer paper.
How to perform input and output operation on a text file.
Answer
Sign in to view the complete answer paper.
How to use enumerator and iterator to cycle through the elements of a collection object?
Answer
Sign in to view the complete answer paper.
Describe the random access file operations.
Answer
Sign in to view the complete answer paper.
Enumerate the steps used to connect to database using JDBC.
Answer
Sign in to view the complete answer paper.
Design an application that handles the button click event.
Answer
Sign in to view the complete answer paper.
How to pass parameters to applets? Illustrate using Java Code.
Answer
Sign in to view the complete answer paper.
What is the importance of adapter classes and list out the event listeners and the corresponding adapter classes?
Answer
Sign in to view the complete answer paper.
List out the security issues of applets?
Answer
Sign in to view the complete answer paper.