Tribhuvan University
Bachelor of Computer Application
Semester 3 · TU Board 2024
Course Title: Object Oriented Programming in Java (CACS204)
Full Marks: 60Pass Marks: 24Time: 3 hours
Candidates are required to answer the question in their own words as far as possible.
Group B
Attempt any SIX question.(6 × 5 = 30)
- 2.5
What is constructor? Explain the role of constructor in Java class by considering a suitable example and also list the type of constructor.
- 3.5
Define inheritance. Explain types of inheritance with suitable example.
- 4.5
Define Package. Explain steps in creation and implementation of package with example.
- 5.5
What is multithreading? How does Java support inter-thread communication? Explain with example.
- 6.5
How to handle multiple catch blocks for a nested try block? Explain with an example.
- 7.5
What is difference between String and String buffer and explain 3 methods of String and String Buffer class with example.
- 8.5
Write short notes on: (any two) i. JDBC Driver ii. Access Modifiers iii. JDK, JRE and JVM
Group C
Attempt any TWO questions(2 × 10 = 20)
- 9.10
Define array and multi dimensional array. Write a program to read two m x n matrices, perform multiplication operation and store result in third matrix.
- 10.10
Write a program to create the following simple GUI based application. If user press the Submit button, your program should store the information in a file named "exam.txt" only when he accepts the terms and condition otherwise it should display a message "please accept the terms and condition first". [figure in the original paper]
- 11.10
Differentiate between overloading and overriding with suitable example WAP to Create a Set with following values: {"London", "NewYork", "SanFrancisco", "Beijing", "NewYork"} Perform operations on above Set:
Add new element Get Set size Remove element Contains element? addAll removeAll retainAll
— The End —