Tribhuvan University
Bachelor of Information Technology Management
Semester 2 · TU Board 2023
Course Title: Object Oriented Programming With Java (IT234)
Full Marks: 60Pass Marks: 30Time: 3 Hrs
Candidates are required to give their answers in their own words as for as practicable.
Group A
Brief Answer Questions(10 × 1 = 10)
- 1.1
List any two Java Buzzwords.
- 2.1
What is the task of Scanner class?
- 3.1
How does for each differ with simple for loop?
Answer comingAlso asked in 2024
- 4.1
Which keyword is used to prevent inheritance in Java?
- 5.1
Define inner class.
Answer comingAlso asked in 2023
- 6.1
How do you call destructor explicitly?
- 7.1
What is dynamic method dispatch?
- 8.1
Why do we need generics?
- 9.1
Differentiate between StringBuffer and String.
- 10.1
How does exception differ with error?
Answer comingAlso asked in 2024
Group B
Short Answer Questions: (Attempt any FIVE Questions)(5 × 3 = 15)
- 11.3
Does object oriented concept is possible without this keyword? Justify.
- 12.3
Write a program to illustrate the chain of constructor in inheritance.
- 13.3
Describe any three types of operators used in Java.
- 14.3
Write a Java program to find the sum of two and three integer using concept of method overloading.
- 15.3
Describe the need of Abstract class with an example.
- 16.3
Why do we need static method? Illustrate with an example.
Group C
Long Answer Questions: (Attempt any THREE Questions)(3 × 5 = 15)
- 17.5
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.5
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.5
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.5
Write a program to illustrate the concept of creating and importing the packages.
Group D
Comprehensive Answer / Case / Situation Analysis Questions(2 × 10 = 20)
- 21.10
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.10
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.
— The End —