OOPs through Java - R23 - Model paper-2
MODEL QUESTION PAPER – 2
SECTION – I (10 × 5 = 50 Marks)
Answer ALL questions. Each question has (a) and (b) sub-questions.
Unit I
-
(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)
-
(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
-
(a) Explain method overloading and method overriding with suitable examples. (5M)
(b) Write a Java program to demonstrate the use of thefinal
keyword (variable, method, class). (5M)
-
(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
-
(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)
-
(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 thesuper
keyword. (5M)
Unit IV
-
(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 theRandom
class and display them in ascending order. (5M)
-
(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
-
(a) Differentiate between
String
,StringBuffer
, andStringBuilder
. (5M)
(b) Write a program to create a thread that prints numbers from 1 to 10 usingRunnable
interface. (5M)
-
(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.
-
List any two OOP principles.
-
What is a symbolic constant in Java?
-
Give an example of constructor overloading.
-
What is the purpose of the
this
keyword? -
Write the syntax of a multi-dimensional array declaration.
-
Define interface. Give an example.
-
What is autoboxing?
-
Write the syntax of a
try-catch
block. -
Mention any two differences between
throw
andthrows
. -
What is the role of
DriverManager
in JDBC?
Comments
Post a Comment