CS322 - Object Oriented Programming Concepts With Java - UG - 1st Sem-Dec-2022
CS322 - Object Oriented Programming Concepts With Java - UG - 1st Sem-Dec-2022
Register Number:
Date:
PART A
CS-322-A-22
2
b) More than one method with same name, same signature but different number
of signature
c) More than one method with same name, same signature, same number of
parameters but different type
d) More than one method with same name, same number of parameters and type
but different signature
5. Which of the following is a valid declaration of an object of class Box?
a) Box obj = new Box();
b) Box obj = new Box;
c) obj = new Box();
d) new Box obj;
6. What is true about constructor?
a) It can contain return type
b) It can take any number of parameters
c) It can have any non access modifiers
d) Constructor cannot throw an exception
7. Which of the following statements are incorrect?
a) String is a class
b) Strings in java are mutable
c) Every string is an object of class String
d) Java defines a peer class of String, called StringBuffer, which allows string to
be altered
8. Which of these is correct way of inheriting class A by class B?
a) class B + class A {}
b) class B inherits class A {}
c) class B extends A {}
d) class B extends class A {}
9. If a class inheriting an abstract class does not define all of its function then it will
be known as?
a) Abstract
b) A simple class
c) Static class
d) None of the mentioned
10. Which of these class can generate an array which can increase and decrease in
size automatically?
a) ArrayList()
b) DynamicList()
c) LinkedList()
d) MallocList()
PART B
11. Write programs to demonstrate the difference between method overloading and
method overriding in Java. (3 +3 marks)
12. Explain different string handling functions and their syntax in java language.
13. Write a program in java to do the following: a) To swap the two numbers without
using the third variable b) Factorial of a number. (3 +3 marks)
14. Explain about interfaces. How they are different from the abstract classes?
CS-322-A-22
3
(3 +3 marks)
15. Develop a GUI application which displays a welcome message when the button
named ok is clicked.
16. Write a short note on : a) Finalize b) Multiple catch with single try statement.
(3 +3 marks)
PART C
18. a) What is class? How to create object for the class? (4 marks)
b) Define super. Explain the use of super with suitable example. (6 marks)
19.a) How to create and import package in Java? Explain with an example. (6 marks)
b) List out the four main differences between Procedure Oriented and Object
CS-322-A-22
4
CS-322-A-22