OOPs through Java - R23 - Model paper-1

 

MODEL QUESTION PAPER - 1

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 features of Object-Oriented Programming with examples. (5M)
    (b) Write a Java program to print the Fibonacci series up to n terms. (5M) 

(OR)
  1. (a) Explain operator precedence and associativity with suitable examples. (5M)
    (b) Differentiate between while and do-while loops with example programs. (5M)


Unit II

  1. (a) What is a constructor? Explain different types of constructors with examples. (5M)
    (b) Write a Java program to demonstrate method overloading. (5M)

(OR)
  1. (a) Explain the role of the this keyword in Java with examples. (5M)
    (b) Write a Java program to illustrate the use of static variables and static methods. (5M)


Unit III

  1. (a) Explain single, multilevel, and hierarchical inheritance with examples. (5M)
    (b) Write a Java program to add two matrices using two-dimensional arrays. (5M)

(OR)
  1. (a) Differentiate between abstract classes and interfaces. (5M)
    (b) Write a Java program to demonstrate multiple inheritance using interfaces. (5M)


Unit IV

  1. (a) What are packages in Java? Explain how to create and use user-defined packages. (5M)
    (b) Write a Java program to demonstrate exception handling using try-catch-finally. (5M)

(OR)
  1. (a) Explain the significance of wrapper classes and autoboxing/unboxing in Java. (5M)
    (b) Write a program to create and use a user-defined exception. (5M)


Unit V

  1. (a) Explain the methods available in the StringBuffer and StringBuilder classes. (5M)
    (b) Write a program to create two threads using the Thread class and Runnable interface. (5M)

(OR)
  1. (a) Explain the steps to connect a Java program with a database using JDBC. (5M)
    (b) Write a simple JavaFX program to display a button and handle its click event. (5M)


SECTION – II (10 × 2 = 20 Marks)

Answer ALL questions. Each question carries 2 marks.

  1. Define literals in Java with examples.

  2. Differentiate between == and equals() in Java.

  3. What is a copy constructor?

  4. What is method overriding?

  5. Define dynamic method dispatch.

  6. Write the syntax of the import statement in Java.

  7. What is the difference between throw and throws?

  8. List two features of JDBC.

  9. What is the difference between String and StringBuffer?

  10. Define multithreading. List any two advantages.

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