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)

  1. Explain the basic principles of Object-Oriented Programming in Java with examples.

  2. Describe the different types of operators in Java with suitable examples.

  3. Discuss different types of control statements in Java with syntax and examples.

🔹 5 Marks (Short Essay)

  1. Differentiate between procedural programming and object-oriented programming.
  2. Write a program to demonstrate command line arguments.

  3. Explain scope and lifetime of variables in Java.

  4. Write short notes on type casting in Java with example.

  5. Explain the use of relational and logical operators with examples.

  6. Write a Java program to find the largest of three numbers using if-else.

  7. Differentiate between while loop and do-while loop with an example.

  8. Explain the difference between break and continue statements with examples.

🔹 2 Marks (Short Answer)

  1. Define object-oriented programming.
  2. List any two features of Java.

  3. What is bytecode in Java?

  4. Define variable and constant.

  5. What is the difference between ++a and a++?

  6. Define dynamic binding.

  7. What is a symbolic constant?

  8. List any two escape sequence characters in Java.

  9. What is type casting?

  10. What is the difference between while and do-while loop?

  11. Define ternary operator with syntax.

  12. What is the scope of a local variable?

  13. Write the syntax of a switch statement.

  14. Define relational operator with an example.

  15. What is the use of continue statement?


UNIT II: Classes and Objects

🔹 10 Marks

  1. Explain the concept of constructors in Java with types and examples.

  2. Discuss different types of methods in Java.

  3. Explain access specifiers in Java with examples.

🔹 5 Marks

  1. Explain the role of constructors in Java with suitable examples.
  2. Differentiate between method overloading and method overriding.

  3. Write a short note on static variables and static methods.

  4. Explain the use of this keyword with an example program.

  5. Discuss access specifiers in Java with an example.

  6. Write a short program to illustrate recursion in Java.

  7. Explain the difference between instance methods and class methods with examples.

  8. Write short notes on final class, final variable, and final method.

🔹 2 Marks

  1. Define class and object.
  2. What is a constructor?

  3. Write one difference between constructor and method.

  4. What is a final method?

  5. Define method overloading.

  6. What is access specifier? Give an example.

  7. Write the difference between this and super.

  8. What is a nested class?

  9. What is a static method?

  10. Define recursion.

  11. Write the syntax for object creation in Java.

  12. What is the difference between instance variable and class variable?

  13. Define encapsulation.

  14. What is a default constructor?

  15. What is the use of return statement in Java?


UNIT III: Arrays, Inheritance, Interfaces

🔹 10 Marks

  1. Explain different types of inheritance supported in Java with examples.

  2. Describe the process of implementing interfaces in Java with an example.

  3. Write about arrays in Java – declaration, initialization, and operations with examples.

🔹 5 Marks

  1. Explain the declaration and initialization of arrays in Java.
  2. Write a program to search an element in a two-dimensional array.

  3. Discuss different types of inheritance in Java.

  4. Explain method overriding with a suitable example.

  5. Differentiate between abstract class and interface.

  6. Explain dynamic method dispatch with example.

  7. Write a program to sort elements in a one-dimensional array.

  8. Explain the use of super keyword in inheritance with example.

🔹 2 Marks

  1. What is an array?
  2. Write the syntax for declaring a one-dimensional array.

  3. What is the default value of array elements in Java?

  4. Define two-dimensional array.

  5. Write the difference between length and length() in Java arrays.

  6. What is inheritance?

  7. List different types of inheritance in Java.

  8. What is the use of super keyword?

  9. Define method overriding.

  10. What is dynamic method dispatch?

  11. What is an abstract class?

  12. Define interface.

  13. Write two differences between abstract class and interface.

  14. What is multiple inheritance and how is it achieved in Java?

  15. What is a functional interface?


UNIT IV: Packages, Java Library, Exception Handling, I/O

🔹 10 Marks

  1. Explain exception handling in Java with hierarchy and suitable examples.

  2. Discuss the process of creating and using packages in Java.

  3. Explain Java I/O streams with examples.

🔹 5 Marks

  1. Explain the process of creating and importing packages in Java.
  2. Write short notes on wrapper classes in Java.

  3. Differentiate between checked exceptions and unchecked exceptions with examples.

  4. Explain the use of throw and throws keywords with examples.

  5. Write a short program to demonstrate exception handling using try-catch-finally.

  6. Explain auto-boxing and unboxing with example.

  7. Write a program to read and write data using FileReader and FileWriter classes.

  8. Explain the use of Scanner class for user input with examples.

🔹 2 Marks

  1. Define package.
  2. What is classpath in Java?

  3. Name any two classes in java.util package.

  4. What is wrapper class? Give an example.

  5. Define auto-boxing.

  6. What is unboxing?

  7. Define exception.

  8. Write the difference between checked and unchecked exceptions.

  9. What is the use of throw keyword?

  10. Differentiate between throw and throws.

  11. What is the use of finally block?

  12. Write two uses of Scanner class.

  13. Define byte stream with an example.

  14. Define character stream with an example.

  15. What is the difference between FileReader and FileWriter?


UNIT V: Strings, Multithreading, JDBC, JavaFX

🔹 10 Marks

  1. Explain string handling in Java with examples of String, StringBuffer, and StringBuilder.

  2. Discuss the life cycle of a thread in Java with examples.

  3. Explain JDBC architecture with steps to connect Java with MySQL.

  4. Write about event handling in JavaFX with suitable examples.

🔹 5 Marks

  1. Differentiate between String and StringBuffer classes.
  2. Write a program to demonstrate string comparison using equals() and compareTo().

  3. Explain the life cycle of a thread with a neat diagram.

  4. Write a short program to create multiple threads using Runnable interface.

  5. Explain thread synchronization with a suitable example.

  6. Discuss the steps to establish a JDBC connection with MySQL database.

  7. Write short notes on ResultSet interface in JDBC.

  8. Explain event handling in JavaFX with example.

🔹 2 Marks

  1. What is immutable string?
  2. Differentiate between String and StringBuffer.

  3. What is the use of equals() method in String?

  4. Write the difference between == and equals() in Java.

  5. What is the purpose of StringBuilder class?

  6. Define multithreading.

  7. Write two differences between process and thread.

  8. What is the difference between start() and run() methods?

  9. What is thread synchronization?

  10. Define deadlock.

  11. What is JDBC?

  12. Write the steps to load a JDBC driver.

  13. Mention any two JDBC drivers.

  14. What is a ResultSet in JDBC?

  15. Define JavaFX.


Comments

Popular posts from this blog

Artificial Intelligence - UNIT - 1 Topic - 1 : Introduction to AI (Artificial Intelligence)

Career Guide - B.Tech Students

OBJECT ORIENTED PROGRAMMING THROUGH JAVA : Unit - 3 : Topic - 1 : Arrays