JNTU
JNTU B.Tech II JAVA PROGRAMMING Previous Question Paper (April/May - 2023 - R13)
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 Default Constructor and Parameterized constructor?
Answer
A Default Constructor is a constructor that takes no arguments. If a class does not explicitly define any constructor, the Java compiler automatically provides a no-argument default constructor to initialize object members to their default values (e.g., 0, null, or false).
A Parameterized Constructor is a constructor that accepts one or more arguments. It is used to provide different values to distinct objects at the time of their creation, allowing for custom initialization of instance variables.
List the different ways to read input from console in java.
Answer
There are three primary ways to read input from the console in Java:
- Scanner Class: Part of the java.util package, this is the most common and easiest way to read primitive types and strings using regular expressions. It provides methods like nextInt(), nextDouble(), and nextLine().
- BufferedReader Class: Found in the java.io package, this is used with an InputStreamReader. It reads data as a stream of characters and is generally faster than Scanner because it buffers the input, though it requires manual parsing of data types.
- Console Class: Introduced in Java 6, the java.io.Console class is specifically designed for console-based applications. It provides methods like readLine() and readPassword(), the latter of which allows for secure input by not echoing characters to the screen.
What is an anonymous inner class?
Answer
Sign in to view the complete answer paper.
What are the member access rules?
Answer
Sign in to view the complete answer paper.
What is exception?
Answer
Sign in to view the complete answer paper.
What is the difference between thread and process?
Answer
Sign in to view the complete answer paper.
What is Hash table in java?
Answer
Sign in to view the complete answer paper.
Define stream. List types of streams.
Answer
Sign in to view the complete answer paper.
What is an applet?
Answer
Sign in to view the complete answer paper.
Define Event, Panel and container.
Answer
Sign in to view the complete answer paper.
Part B
Explain the features of Java.
Answer
Sign in to view the complete answer paper.
What are static variables and static methods?
Answer
Sign in to view the complete answer paper.
Define Constructor. What is constructor overloading? Write a program to illustrate the same.
Answer
Sign in to view the complete answer paper.
Explain the process of creating and accessing packages with suitable example.
Answer
Sign in to view the complete answer paper.
Explain abstract class with an example and compare with interface
Answer
Sign in to view the complete answer paper.
Explain inheritance and its types? How runtime polymorphism can be achieved using inheritance, explain with a suitable program?
Answer
Sign in to view the complete answer paper.
Write a program using try and catch block to check whether the given array size is negative or not.
Answer
Sign in to view the complete answer paper.
Define and differentiate multiprocessing and multithreading.
Answer
Sign in to view the complete answer paper.
Differentiate between throw and throws. Give example.
Answer
Sign in to view the complete answer paper.
Explain thread synchronization briefly.
Answer
Sign in to view the complete answer paper.
What is an Iterator class? Describe any two methods of Iterator class example.
Answer
Sign in to view the complete answer paper.
Write Java JDBC program that update the records in a Student table in Database containing the fields Roll Number (Integer), Name (String), Branch (String), Percentage (Float) based on Roll Number (Integer).
Answer
Sign in to view the complete answer paper.
Write a Java program to read a text file then count and display no. of lines, words in it.
Answer
Sign in to view the complete answer paper.
Write a short note on String Tokenizer.
Answer
Sign in to view the complete answer paper.
How to pass parameters to an applet? Write an applet to accept Account number and balance in the form of parameter and print message “low balance” if balance is less than 500.
Answer
Sign in to view the complete answer paper.
Write a swing application which uses JTabbed Pane and JPanel.
Answer
Sign in to view the complete answer paper.
How Event handling is done in java?
Answer
Sign in to view the complete answer paper.