BITM 2nd Semester
Object Oriented Programming With Java Board Question Paper 2023


TRIBHUVAN UNIVERSITY
FACULTY OF MANAGEMENT
Office of the Dean
March - April 2023
Full Marks:60 Pass Marks:30 Time:3 Hrs.
BIM /
Second Semester /
IT 234:
Object Oriented Programming With Java

Candidates are required to give their answers in their own words as for as practicable.
The figures in the margin indicate full marks

Long Answer Questions
Section "A"

Brief Answer Questions:

[10 × 1 = 10]
1.

What is the significance of bytecode?

2.

Why main() is declared as static?

3.

What is the task of scanner class?

4.

Define encapsulation.

5.

Write syntax for defining a package in Java.

6.

Define method overloading.

7.

What is the role of this keyword?

8.

Differentiate between Checked and Unchecked exception.

9.

Differentiate between super class and sub class.

10.

Write an importance of generic class.

Section "B"

Short Answer Questions: (Attempt any FIVE Questions)

[5 × 3 = 15]
11.

Write a program to find the second largest integer from an array.

12.

Define and mention the use of final data member, final method and final class.

13.

Why do we need wrapper classes? Explain.

14.

Write a Java program to display whether a character is an alphabet or not.

15.

Write an example program of inner class.

16.

Write an example program that contains a generic class.

Section "C"

Long Answer Questions: (Attempt any THREE Questions)

[3 × 5 = 15]
17.

Create an interface Exam with methods setExam(String division, int mark) and showExam(). Create a class named test that implements the interface Exam and then display the records.

18.

Create a class named Book with instance variables title and price. Add a method named setVar to pass parameters for title and price. Add another method named showVar to display values of these variables. Now in main (), declare 4 objects of book and display the records of book that starts with "Java".

19.

Create a class name Movie (id, genre). Write the object of Movie class into file named "Comedy.dat" having comedy as genre.

20.

Write a program to create a class student with data member roll and name. Sort the 10 objects of this class on the basis of name.

Section "D"

Comprehensive Answer / Case / Situation Analysis Questions:

[2 × 10 = 20]
21.

Define Exception. Why should we handled an Exception? Write a Java program to create a class Mobile (type, Phone_no). Customize the exception such that if the user give phone_no having less than or greater than 10 digit, then the program has to throw an exception with the message "Invalid Phone number".

22.

Define Inheritance. List different types of inheritance. Explain the chain of constructor and destructor between sub class and super class.