OOPs through Java - R23 - Model paper-2


 

MODEL QUESTION PAPER – 2

Object-Oriented Programming through Java
Time: 3 Hours                                                                                                          Max Marks: 70


SECTION – I (10 × 5 = 50 Marks)

Answer ALL questions. Each question has (a) and (b) sub-questions.

Unit I

  1. (a) Explain the differences between Procedural Programming and Object-Oriented Programming. (5M)
    (b) Write a Java program to find whether a number is prime or not using loops. (5M)

(OR)
  1. (a) Explain different types of operators in Java with examples. (5M)
    (b) Write a program to calculate factorial of a number using command line arguments. (5M)


Unit II

  1. (a) Explain method overloading and method overriding with suitable examples. (5M)
    (b) Write a Java program to demonstrate the use of the final keyword (variable, method, class). (5M)

(OR)
  1. (a) Explain the concept of recursion in Java with an example. (5M)
    (b) Write a program to demonstrate the difference between call by value and call by reference. (5M)


Unit III

  1. (a) Write a note on one-dimensional and two-dimensional arrays with examples. (5M)
    (b) Write a Java program to perform binary search on an array. (5M)

(OR)
  1. (a) What is multiple inheritance? Explain how it is implemented in Java with an example. (5M)
    (b) Write a program that demonstrates constructor chaining using the super keyword. (5M)


Unit IV

  1. (a) Explain the importance of Java library packages. Mention any four classes of java.util. (5M)
    (b) Write a program to generate random numbers using the Random class and display them in ascending order. (5M)

(OR)
  1. (a) Differentiate between checked and unchecked exceptions with examples. (5M)
    (b) Write a program to create and throw a custom exception when a user enters a negative number. (5M)


Unit V

  1. (a) Differentiate between String, StringBuffer, and StringBuilder. (5M)
    (b) Write a program to create a thread that prints numbers from 1 to 10 using Runnable interface. (5M)

(OR)
  1. (a) Explain the architecture of JDBC. (5M)
    (b) Write a JavaFX program to display a label and a text field where the user enters their name. (5M)


SECTION – II (10 × 2 = 20 Marks)

Answer ALL questions. Each carries 2 marks.

  1. List any two OOP principles.

  2. What is a symbolic constant in Java?

  3. Give an example of constructor overloading.

  4. What is the purpose of the this keyword?

  5. Write the syntax of a multi-dimensional array declaration.

  6. Define interface. Give an example.

  7. What is autoboxing?

  8. Write the syntax of a try-catch block.

  9. Mention any two differences between throw and throws.

  10. What is the role of DriverManager in JDBC?

Comments

Popular posts from this blog

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

Road Map - Python Full Stack development

OOPs through Java - R23 - Model paper-1