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


TRIBHUVAN UNIVERSITY
FACULTY OF MANAGEMENT
Office of the Dean
October 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.

List any two Java Buzzwords.

2.

What is the task of Scanner class?

3.

How does for each differ with simple for loop?

4.

Which keyword is used to prevent inheritance in Java?

5.

Define inner class.

6.

How do you call destructor explicitly?

7.

What is dynamic method dispatch?

8.

Why do we need generics?

9.

Differentiate between StringBuffer and String.

10.

How does exception differ with error?

Section "B"

Short Answer Questions: (Attempt any FIVE Questions)

[5 × 3 = 15]
11.

Does object oriented concept is possible without this keyword? Justify.

12.

Write a program to illustrate the chain of constructor in inheritance.

13.

Describe any three types of operators used in Java.

14.

Write a Java program to find the sum of two and three integer using concept of method overloading.

15.

Describe the need of Abstract class with an example.

16.

Why do we need static method? Illustrate with an example.

Section "C"

Long Answer Questions: (Attempt any THREE Questions)

[3 × 5 = 15]
17.

Create an interface "Shape" with a method void Myshape(String name). Create two class "Rectangle" and "Circle" to implement this method. Then instantiate object for each class to call Myshape(String) function.

18.

Write a program to create a class named "person" with number field "age". Throw an exception if the user enters negative number for the age.

19.

Create a class named "Course" with data member title, credit and courseCode and a method named void setValues() to assign the values and another method named showValues to display the record. In main(), instantiate 5 objects of course and display the record of course whose title start with "C".

20.

Write a program to illustrate the concept of creating and importing the packages.

Section "D"

Comprehensive Answer / Case / Situation Analysis Questions:

[2 × 10 = 20]
21.

Why do we need wrapper classes? Write a program to take a string from the user and if the length of that string is a prime number, write this string into file named "Prime.txt", otherwise write into file named "Composite.txt".

22.

Why autoboxing and unboxing of primitive not happen with generics in Java? Write a program to find whether the integer of even index of an array is odd or not and also display the sum of those odd integers.