Tribhuvan University
Bachelor of Information Technology Management
Semester 2 · TU Board 2023
Course Title: Object Oriented Programming With Java (ITM152)
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
What is the significance of bytecode?
- 2.1
Why main() is declared as static?
- 3.1
What is the task of scanner class?
- 4.1
Define encapsulation.
- 5.1
Write syntax for defining a package in Java.
- 6.1
Define method overloading.
- 7.1
What is the role of this keyword?
- 8.1
Differentiate between Checked and Unchecked exception.
- 9.1
Differentiate between super class and sub class.
- 10.1
Write an importance of generic class.
Group B
Short Answer Questions: (Attempt any FIVE Questions)(5 × 3 = 15)
- 11.3
Write a program to find the second largest integer from an array.
- 12.3
Define and mention the use of final data member, final method and final class.
- 13.3
Why do we need wrapper classes? Explain.
- 14.3
Write a Java program to display whether a character is an alphabet or not.
- 15.3
Write an example program of inner class.
- 16.3
Write an example program that contains a generic class.
Group C
Long Answer Questions: (Attempt any THREE Questions)(3 × 5 = 15)
- 17.5
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.5
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.5
Create a class name Movie (id, genre). Write the object of Movie class into file named "Comedy.dat" having comedy as genre.
- 20.5
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.
Group D
Comprehensive Answer / Case / Situation Analysis Questions(2 × 10 = 20)
- 21.10
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.10
Define Inheritance. List different types of inheritance. Explain the chain of constructor and destructor between sub class and super class.
— The End —