OOPs through Java - R23 - Model paper-1
MODEL QUESTION PAPER - 1
SECTION – I (10 × 5 = 50 Marks)
Answer ALL questions. Each question has (a) and (b) sub-questions.
Unit I
-
(a) Explain the features of Object-Oriented Programming with examples. (5M)
(b) Write a Java program to print the Fibonacci series up ton
terms. (5M)
-
(a) Explain operator precedence and associativity with suitable examples. (5M)
(b) Differentiate betweenwhile
anddo-while
loops with example programs. (5M)
Unit II
-
(a) What is a constructor? Explain different types of constructors with examples. (5M)
(b) Write a Java program to demonstrate method overloading. (5M)
-
(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
-
(a) Explain single, multilevel, and hierarchical inheritance with examples. (5M)
(b) Write a Java program to add two matrices using two-dimensional arrays. (5M)
-
(a) Differentiate between abstract classes and interfaces. (5M)
(b) Write a Java program to demonstrate multiple inheritance using interfaces. (5M)
Unit IV
-
(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 usingtry-catch-finally
. (5M)
-
(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
-
(a) Explain the methods available in the
StringBuffer
andStringBuilder
classes. (5M)
(b) Write a program to create two threads using theThread
class andRunnable
interface. (5M)
-
(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.
-
Define literals in Java with examples.
-
Differentiate between
==
andequals()
in Java. -
What is a copy constructor?
-
What is method overriding?
-
Define dynamic method dispatch.
-
Write the syntax of the
import
statement in Java. -
What is the difference between
throw
andthrows
? -
List two features of JDBC.
-
What is the difference between
String
andStringBuffer
? -
Define multithreading. List any two advantages.
Comments
Post a Comment