0% found this document useful (0 votes)
9 views

Java Question Bank

The document contains a comprehensive set of short and long answer questions covering various concepts of Object-Oriented Programming (OOP) and Java, including OOP principles, Java features, data types, exception handling, GUI components, and JDBC. It is organized into five units, each focusing on different aspects of Java programming, such as classes, objects, threads, and database connectivity. The questions aim to assess understanding and application of Java programming concepts and techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Java Question Bank

The document contains a comprehensive set of short and long answer questions covering various concepts of Object-Oriented Programming (OOP) and Java, including OOP principles, Java features, data types, exception handling, GUI components, and JDBC. It is organized into five units, each focusing on different aspects of Java programming, such as classes, objects, threads, and database connectivity. The questions aim to assess understanding and application of Java programming concepts and techniques.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Short Answer Questions

Unit 1
1) Mention the OOPS concepts
2) Define Polymorphism in OOPS
3) Define Encapsulation in OOPS
4) Define Data Hiding in OOPS
5) Define Abstraction in OOPS
6) What is Inheritance in OOPS
7) List down the benefits of OOPS
8) What is Platform Independency? How it is achieved in Java
9) Define JVM and Bytecode
10) Define JDK and JRE
11) Mention two differences between C and Java
12) Mention two differences between C++ and Java
13) What is command Line argument
14) What is a constant. How you define a constant in Java
15) What is a symbolic constant. How you define a symbolic constant in Java
16) What is a variable. How you declare, define and initialize a variable in java
17) Mention two mathematical functions available in Java and how it is used.
Unit II
1) Define the terms Class and Object in Java
2) How you define a class in Java.
3) How you create an object in java. How can you access the data members and methods
using the object
4) Define the meaning of static keyword in java. (mention static variable, static method)
5) Define an Array. What are the different types of array.
6) What is a string. How a string is initialized in Java
7) List down 2 methods available in String class
8) Define a Vector
9) Define wrapper classes. Mention two wrapper classes available in Java
10) What is autoboxing and unboxing. Explain with example
11) Distinguish between ‘this’ and ‘super’ keyword
12) Define keyword final in java( mention final variable, final method, final class)
13) What is a finalizer method
14) What is an abstract method
Unit III
1) What is package. How you define a package
2) What are the different types of packages.
3) How can you use one package in another package
4) Define a thread.
5) What is the difference between multithreading and multiprocessing
6) Mention two methods available in Thread class with syntax
7) What is the significance of finally clause
8) Differentiate Checked and Unchecked exceptions
9) Differentiate throw and throws keyword
10) Define Exception
Unit IV
1. What is Abstract Window Tool kit?
2. Why AWT is platform dependent?
3. Why Swing is platform independent?
4. Explain the types of Container in AWT?
5. List down five GUI components in Swing
6. Differentiate a component and a container.
7. What is Stream?
8. What are the two different types of streams.
9. How to create file in Java?
10. What is buffering?
11. What is the use of DataInputStream and DataOutputStream?
12. Differentiate Byte Stream Classes and Character Stream classes

Unit V
1) What is JDBC
2) What is JDBC driver. Mention the types of JDBC drivers
3) Mention different types of JDBC statements
4) What is a callable statement
5) What is Prepared Statement
6) What is ResultSet interface.
7) What are the different types of ResultSet
8) What is DatabaseMetadata. Mention two methods in DatabaseMetadata
9) What is ResultSetMetadata. Mention two methods in ResultSetMetadata

Long Answer Questions


1) Explain Features of OOPS
2) Explain Features of Java
3) Explain the structure of JVM
4) Explain Program Structure of Java
5) Explain different data types available in Java
6) Explain different Scope of variables in Java. Illustrate with example.
7) What is type casting. Explain different types of type casting with suitable example
8) Discuss different operators available in Java
9) Explain how break and continue statements are used in programs with suitable
examples
10) Explain different branching statements used in Java with suitable examples
(if, if else, nested if, else if ladder, switch, conditional operator)
11) Explain different Looping statements available in Java with suitable examples
(while, do while , for, for each)
12) What are labelled loops. How it works in Java. Explain with example.

Unit II
1) Define Constructor. Explain different types of constructors (write suitable examples)
2) What is Method Overloading. Explain with example
3) Differentiate between overloading and overriding
4) Define an array. Write a program to sort elements in an array( any 1D/2D array
program)
5) Define a Vector. Write a program to demonstrate how Vector class is used.
6) What are the e wrapper classes available in Java. Explain how autoboxing and
unboxing is done.
7) Define Inheritance. Explain different types of inheritance available in Java
8) What is Overriding. Explain with example
9) Explain different access specifiers in Java (or visibility Controls)
10) What is an abstract class. How it is defined.
11) What is an interface. How it is defined. How an interface be implemented.
12) Differentiate between extending and interface and implementing an interface
Unit III
1) Explain the steps in creating and using a User Defined Package
2) Define Thread. Explain Life Cycle of a Thread with neat diagram
3) Explain different ways in which a thread is created (using extends Thread and
implements Runnable)
4) Write a note on i) Thread Exception ii) Thread Synchronization
5) Explain how to start, stop and block a thread
6) Explain how to handle exceptions in java
7) Explain how multiple catch blocks work in exception handling
8) Explain how to create user defined exceptions and how to throw the same
Unit IV
1. Explain the Frame class with an example.
2. Explain the different types of Layout Managers.
3. Explain the AWT hierarchy?
4. Mention any four methods in Component class.
5. Write down the differences between Frame & Panel.
6. Explain the Frame class with a simple program.
7. What is an event? What are the components of Event Handling?
8. Explain Event Delegation Model.
9. Distinguish between AWT and Swing
10. Explain the below GUI controls with simple program.
a. JLabel b. JButton c. JTextField d. JTextArea
11. Explain Java Swing class Hierarchy.
12. Explain briefly the classification of Byte Stream.
13. Explain briefly the classification of Character Stream.
14. Explain Reader and Writer.
15. Write a note on IOException
16. Write a program to read and write bytes.
17. Write a program to read and write characters.
18. Write a program to read and write primitive data types

Unit V
1) Explain different types of JDBC drivers
2) Explain the steps to connect a Java application with the database using JDBC
3) What is Statement interface. How to create Statement object and execute it.
4) What is PreparedStatement. How to create the object, set values and execute it
5) What is CallableStatement. How to create the object, set values and execute it

You might also like