You are on page 1of 4

Mohamed

Nageeb/.

20196575/CES Assignment ( 2 )

1. Which of the following best defines a class?

a) Parent of an object

b) Instance of an object

c) Blueprint of an object

d) Scope of an object

2. Which is not feature of OOP in general defini�ons?

a) Code reusability

b) Modularity

c) Duplicate/Redundant data

d) Efficient Code

3. Pure OOP can be implemented without using class in a program. (True or False)

a) True

b) False

4. Which Feature of OOP illustrated the code reusability?

a) Polymorphism

b) Abstrac�on

c) Encapsula�on

d) Inheritance

5. How many classes can be defined in a single program?

a) Only 1

b) Only 100

c) Only 999

d) As many as you want


6. Why Java is Par�ally OOP language?

a) It supports usual declara�on of primi�ve data types

b) It doesn’t support all types of inheritance

c) It allows code to be writen outside classes

d) It does not support pointers

7. Which of the following is/are advantage of using object oriented programming?

a) Code Reusability

b) Can create more than one instance of a class without interference

c) Pla�orm independent

d) All of the men�oned

8. Java Compiler translates the source code into?

a) Machine code

b) Assembly code

c) Byte code

d) JVM code

9. Which of the following is not OOPS concept in Java?

a) Inheritance

b) Encapsula�on

c) Polymorphism

d) Compila�on

10. When Overloading does not occur?

a) More than one method with same name but different method signature and different number or type of
arameters

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
11. Which concept of Java is a way of conver�ng real world objects in terms of class?

a) Polymorphism

b) Encapsula�on

c) Abstrac�on

d) Inheritance

12. Method overriding is combina�on of inheritance and polymorphism?

a) True

b) false

13. What does polymorphism in OOPs mean?

a) Concept of allowing overiding of func�ons

b) Concept of hiding data

c) Concept of keeping things in differnt modules/files

d) Concept of wrapping things into a single unit

14.Which concept allows you to reuse the writen code?

a) Encapsula�on

b) Abstrac�on

c) Inheritance

d) Polymorphism

15. Which of the following is not a type of Constructor?

a) Friend constructor

b) Copy constructor

c) Default constructor

d) Parameterized constructor

16. What is the other name used for func�ons inside a class?

a) Member variables

b) Member func�ons

c) Class func�ons

d) Class variables
17. Which of the following cannot be a friend?

a) Func�on

b) Class

c) Object

d) Operator func�on

18.Which of the following is not a Java features?

a) Dynamic

b) Architecture Neutral

c) Use of pointers

d) Object-oriented

19. What does the expression float a = 35 / 0 return?

a) 0

b) Not a Number

c) Infinity

d) Run �me excep�on

20.Which of the following for loop declara�on is not valid?

a) for ( int i = 99; i >= 0; i / 9 )

b) for ( int i = 7; i <= 77; i += 7 )

c) for ( int i = 20; i >= 2; - -i )

d) for ( int i = 2; i <= 20; i = 2* i )

You might also like