We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
Only for 2021, | TRIBHUVAN UNIVERSITY
rap sanittied . Full Marks: 60
Regular FACULTY OF MANAGEMENT Pass Marks: 30
‘Students Office of the Dean Time: 3 Hrs.
. March - April 2023
BIM / Second Semester / IT 234: Object Oriented Programming with Java
Candidates are required to answer the questions in their own words as far as practicable.
Brief Answer Questions: [10 x 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 teyword?
8. Differentiate between Checked and Unchecked exception.
9. _ Differentiate between super class and sub class. :
10. Write an importance of generic class.
Group “B”
Short Answer Questions: (Attempt any FIVE Questions) [5x3 = 15]
_-Alle 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.
e-sl3e Why do we need wrapper classes? Explain.
14, Write a Java program to display whether a character is an alphabet or not.
457 Write an example program of inner class.
_,16-—Write an example program that contains a generic clas.
Group “C”
Long Answer Questions: (Attempt any THREE Questions) Bx5=15]
V7 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
O- 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 (Q), 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.
Group “D”
Comprehensive Answer / Case / Situation Analysis Questions: [2 x10= 20]
2p 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".
2g Define Inheritance. List different types of inheritance. Explain the chain of constructor
and destructor between sub class and super class.
ae