2082 Pre-Board examination question paper set for Object Oriented Programming in Java.
Tribhuvan University
Faculty of Humanities & Social Sciences
OFFICE OF THE DEAN
2025
Bachelor in Computer Applications
| Paper detail | Value |
|---|---|
| Course | Object Oriented Programming in Java |
| Code No. | CACS204 |
| Semester | IIIrd |
| Full marks | 60 |
| Pass marks | 24 |
| Time | 3 hours |
Candidates are required to answer the questions in their own words as far as possible.
2. Explain the difference between method overloading and method overriding with examples.
3. What is the role of the final keyword in Java? Explain with an example.
4. Write a Java program to find the factorial of a number using recursion.
5. What is the difference between abstract class and interface?
6. Describe the use of this and super keywords with examples.
7. Explain exception handling in Java using try, catch, and finally.
8. Differentiate between object and class with real-world examples.
9. Write a short note on: a) Access Modifier in Java. b) JVM and JRE.
10. a) Design a Java class BankAccount with the following specifications: - Data members: accountNumber, accountHolder, balance. - Member methods: deposit(amount) - adds amount to balance, withdraw(amount) - deducts amount if sufficient balance exists, displayDetails() - prints account details. Write a program to demonstrate all functionalities. b) Explain the concept of constructor overloading in Java. Write a program that defines a Student class with multiple constructors for different initialization needs (e.g., roll number only, roll number and name, all details).
11. a) What is polymorphism? Describe the two types of polymorphism in Java: - Compile-time polymorphism with method overloading, - Run-time polymorphism with method overriding. Support your explanation with Java code examples. b) Discuss dynamic method dispatch in Java. Write a program where a superclass reference is used to call overridden methods in subclass objects. Explain the output to show how polymorphism works at runtime.