You are on page 1of 2

Object oriented Programming home quiz (15%)

Rule: Copying from other student is evaluated to zero.


Part One: Say True if the statement is correct or False if the statement is wrong(2.5%)
1. Compiler is used to translate high level language to machine language and vice versa
2. Paradigm is a method to solve problem.
3. Hiding implementation of object from client is known as Encapsulation.
4. Continue statement forces to stop iteration and continues next iteration.
5. Class is a group of objects which have common properties.
6. A collection of statement that are grouped together to perform specific operation is known as
variable.
7. Method allow reuse of code.
8. This keyword used as reference to object of current class.
9. Dot(.) is used to declare static attributes.
10. Garbage collector is used to reclaim unused memory at run time.
Part Two: Choose the best answer (2%)
1. Which of the following is benefit Object Oriented Programming.
a. Reusability c. Upgrade easily
b. Manage complexity easily d. All
2. Which of the following is not concept of OOP?
a. Encapsulation c. Polymorphism
b. Inheritance d. None
3. Which of following is not primitive data types?
a. Int b. Float c. Array d. Byte
4. Keyword that define access type of method and attributes is known as _____
a. Modifier c. Parameter
b. Return type d. Argument
5. The modifier used to declare class variable and method is
a. Final b. Static c. Abstract d. None
6. return type of constructor is
a. void b. int c. object d. none
7. Which of the following is unary operator.
a. + b. – c. ! d. &&
8. Which of the following characteristic of Java.
a. Both compiled and Interpreted c. Multithreaded
b. Non Portable d. A and C
Part Three: Short Answer (6%)
1. Explain the major programming paradigm.
2. Explain the differences between Procedural and object oriented programming.
3. Explain the differences between for loop, while and do while.
4. Write method signature for sum method which accept 2 parameter.
5. Explain instance variable and class variable.
6. Write and explain types of constructor
Part Four: Code (4.5%)
1. Write a program that display multiplication table.
2. Write syntax of for-each loop.
3. Write code that accept two matrix and display their difference.

You might also like