OOP through Java - R23 - Important Questions
OOP through Java - R23 - Important Questions
📘 Java Question Bank – Unit-wise (with Marking Scheme)
UNIT I: Object-Oriented Programming
🔹 10 Marks (Essay type)
-
Explain the basic principles of Object-Oriented Programming in Java with examples.
-
Describe the different types of operators in Java with suitable examples.
-
Discuss different types of control statements in Java with syntax and examples.
🔹 5 Marks (Short Essay)
- Differentiate between procedural programming and object-oriented programming.
-
Write a program to demonstrate command line arguments.
-
Explain scope and lifetime of variables in Java.
-
Write short notes on type casting in Java with example.
-
Explain the use of relational and logical operators with examples.
-
Write a Java program to find the largest of three numbers using
if-else. -
Differentiate between
whileloop anddo-whileloop with an example. -
Explain the difference between
breakandcontinuestatements with examples.
🔹 2 Marks (Short Answer)
- Define object-oriented programming.
-
List any two features of Java.
-
What is bytecode in Java?
-
Define variable and constant.
-
What is the difference between
++aanda++? -
Define dynamic binding.
-
What is a symbolic constant?
-
List any two escape sequence characters in Java.
-
What is type casting?
-
What is the difference between
whileanddo-whileloop? -
Define ternary operator with syntax.
-
What is the scope of a local variable?
-
Write the syntax of a
switchstatement. -
Define relational operator with an example.
-
What is the use of
continuestatement?
UNIT II: Classes and Objects
🔹 10 Marks
-
Explain the concept of constructors in Java with types and examples.
-
Discuss different types of methods in Java.
-
Explain access specifiers in Java with examples.
🔹 5 Marks
- Explain the role of constructors in Java with suitable examples.
-
Differentiate between method overloading and method overriding.
-
Write a short note on static variables and static methods.
-
Explain the use of
thiskeyword with an example program. -
Discuss access specifiers in Java with an example.
-
Write a short program to illustrate recursion in Java.
-
Explain the difference between instance methods and class methods with examples.
-
Write short notes on final class, final variable, and final method.
🔹 2 Marks
- Define class and object.
-
What is a constructor?
-
Write one difference between constructor and method.
-
What is a final method?
-
Define method overloading.
-
What is access specifier? Give an example.
-
Write the difference between
thisandsuper. -
What is a nested class?
-
What is a static method?
-
Define recursion.
-
Write the syntax for object creation in Java.
-
What is the difference between instance variable and class variable?
-
Define encapsulation.
-
What is a default constructor?
-
What is the use of
returnstatement in Java?
UNIT III: Arrays, Inheritance, Interfaces
🔹 10 Marks
-
Explain different types of inheritance supported in Java with examples.
-
Describe the process of implementing interfaces in Java with an example.
-
Write about arrays in Java – declaration, initialization, and operations with examples.
🔹 5 Marks
- Explain the declaration and initialization of arrays in Java.
-
Write a program to search an element in a two-dimensional array.
-
Discuss different types of inheritance in Java.
-
Explain method overriding with a suitable example.
-
Differentiate between abstract class and interface.
-
Explain dynamic method dispatch with example.
-
Write a program to sort elements in a one-dimensional array.
-
Explain the use of
superkeyword in inheritance with example.
🔹 2 Marks
- What is an array?
-
Write the syntax for declaring a one-dimensional array.
-
What is the default value of array elements in Java?
-
Define two-dimensional array.
-
Write the difference between
lengthandlength()in Java arrays. -
What is inheritance?
-
List different types of inheritance in Java.
-
What is the use of
superkeyword? -
Define method overriding.
-
What is dynamic method dispatch?
-
What is an abstract class?
-
Define interface.
-
Write two differences between abstract class and interface.
-
What is multiple inheritance and how is it achieved in Java?
-
What is a functional interface?
UNIT IV: Packages, Java Library, Exception Handling, I/O
🔹 10 Marks
-
Explain exception handling in Java with hierarchy and suitable examples.
-
Discuss the process of creating and using packages in Java.
-
Explain Java I/O streams with examples.
🔹 5 Marks
- Explain the process of creating and importing packages in Java.
-
Write short notes on wrapper classes in Java.
-
Differentiate between checked exceptions and unchecked exceptions with examples.
-
Explain the use of
throwandthrowskeywords with examples. -
Write a short program to demonstrate exception handling using
try-catch-finally. -
Explain auto-boxing and unboxing with example.
-
Write a program to read and write data using FileReader and FileWriter classes.
-
Explain the use of
Scannerclass for user input with examples.
🔹 2 Marks
- Define package.
-
What is classpath in Java?
-
Name any two classes in
java.utilpackage. -
What is wrapper class? Give an example.
-
Define auto-boxing.
-
What is unboxing?
-
Define exception.
-
Write the difference between checked and unchecked exceptions.
-
What is the use of
throwkeyword? -
Differentiate between
throwandthrows. -
What is the use of
finallyblock? -
Write two uses of
Scannerclass. -
Define byte stream with an example.
-
Define character stream with an example.
-
What is the difference between
FileReaderandFileWriter?
UNIT V: Strings, Multithreading, JDBC, JavaFX
🔹 10 Marks
-
Explain string handling in Java with examples of
String,StringBuffer, andStringBuilder. -
Discuss the life cycle of a thread in Java with examples.
-
Explain JDBC architecture with steps to connect Java with MySQL.
-
Write about event handling in JavaFX with suitable examples.
🔹 5 Marks
- Differentiate between
StringandStringBufferclasses. -
Write a program to demonstrate string comparison using
equals()andcompareTo(). -
Explain the life cycle of a thread with a neat diagram.
-
Write a short program to create multiple threads using
Runnableinterface. -
Explain thread synchronization with a suitable example.
-
Discuss the steps to establish a JDBC connection with MySQL database.
-
Write short notes on ResultSet interface in JDBC.
-
Explain event handling in JavaFX with example.
🔹 2 Marks
- What is immutable string?
-
Differentiate between
StringandStringBuffer. -
What is the use of
equals()method in String? -
Write the difference between
==andequals()in Java. -
What is the purpose of
StringBuilderclass? -
Define multithreading.
-
Write two differences between process and thread.
-
What is the difference between
start()andrun()methods? -
What is thread synchronization?
-
Define deadlock.
-
What is JDBC?
-
Write the steps to load a JDBC driver.
-
Mention any two JDBC drivers.
-
What is a ResultSet in JDBC?
-
Define JavaFX.
Comments
Post a Comment