wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OOP Kuiz 1

Total questions: 12

Worksheet time: 12mins

Name
Class
Date
1.

Who is founder Java language in the early 1990s?

a)

A. James Gosling

b)

B. Dennis Ritchie

c)

C. Ken Thompson

d)

D. Bjarne Stroustrup

2.

What is object?

a)

A. A group of class

b)

B. An instance of class

c)

C. Static and cannot modify

d)

D. Holding both data and functions

3.

Which of the following is NOT the name of a Reserved Word?

a)

A. Static

b)

B. run

c)

C.Main

d)

D. char

4.

4.Which of the following statement is CORRECT?

a)

A. Every statement in a program must end with a semicolon

b)

B. Every line in a program must end with a semicolon

c)

C. Every class must end with a semicolon

d)

D. Every comment line must end with a semicolon

5.

Select the CORRECT statement that describes a run-time error occur when…

a)

A program compiles successfully and block the program

b)

A compiler detects violation of language syntax rules

c)

A program compiles unsuccessful and dies not execute

d)

A program compiles successfully but encounter an error during execution

6.

Which are the main THREE features of OOP concept?

a)

A. Abstraction, Encapsulation, Inheritance and Polymorphism

b)

B. Inheritance, Encapsulation, Class and Persistence

c)

C.Abstraction, Polymorphism, Class and Constructor Inheritance

d)

D. Encapsulation, Object and Typing are the major concept

7.

What is the value of the following expression:

a)

A. 7

b)

B. 8

c)

C. 9

d)

D. 10

8.

Choose the CORRECT output from the block code in figure above :

a)

A. Under

b)

B. Over

c)

C. Under the limit

d)

D. the limit

9.

What attributes do all real world object have?

a)

A. Objects have identity, state and behaviour

b)

B. Object have state and behaviour

c)

C. Object have size and weight

d)

D.Object have existence

10.

Which of the following is CORRECT ?

a)

A.String alpha (“Hello Quiz!”);

b)

B. String = “Hello Quiz!”;

c)

C. String alpha = new “Hello Quiz!”;

d)

D. String alpha = “Hello Quiz”;

11.

Identify the class name, the attributes and the behaviours of the class below in relevant UML/boxes of the class diagram

a)
b)
c)
d)
12.

The following program show how to accepts input from command line and calculate the sum of three input number. Complete the code snippet above :

a)
b)
c)
d)