CACS204 Object Oriented Programming in Java

Object Oriented Programming in Java TU Board 2024 question paper

10 questionsSit this paper (timed)

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)

  1. 2.

    What is constructor? Explain the role of constructor in Java class by considering a suitable example and also list the type of constructor.

    5
  2. 3.

    Define inheritance. Explain types of inheritance with suitable example.

    5
  3. 4.

    Define Package. Explain steps in creation and implementation of package with example.

    5
  4. 5.

    What is multithreading? How does Java support inter-thread communication? Explain with example.

    5
  5. 6.

    How to handle multiple catch blocks for a nested try block? Explain with an example.

    5
  6. 7.

    What is difference between String and String buffer and explain 3 methods of String and String Buffer class with example.

    5
  7. 8.

    Write short notes on: (any two) i. JDBC Driver ii. Access Modifiers iii. JDK, JRE and JVM

    5

Group C

Attempt any TWO questions(2 × 10 = 20)

  1. 9.

    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
  2. 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]

    10
  3. 11.

    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

    10

— The End —