wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OOP Midterms

Total questions: 50

Worksheet time: 31mins

Name
Class
Date
1.

Java is created in 1995 by Oak

a)

TRUE

b)

FALSE

2.

Java is a popular programming language for creating mobile applications, desktop applications, web applications, games, and database connections

a)

TRUE

b)

FALSE

3.

To combine string literals and values, the assignment operator is used.

a)

TRUE

b)

FALSE

4.

The Java Main Class must be enclosed in a method.

a)

TRUE

b)

FALSE

5.

In Java Variable Declaration if there are multiple variables with the same type, you can comma-separate.

a)

TRUE

b)

FALSE

6.

Variables can be of any length.

a)

TRUE

b)

FALSE

7.

Variables should be declared first before you could use them.

a)

TRUE

b)

FALSE

8.

Variables can have numbers and also start with them.

a)

TRUE

b)

FALSE

9.

A problem-solving approach where computations are carried out using objects.

a)

Class

b)

OOP

c)

Objects

d)

Java

10.

Blueprint of the program

a)

Main method

b)

Function

c)

Object

d)

Class

11.

Attribute of an object or an aspect of its behavior

a)

Objects

b)

Properties

c)

Attributes

d)

Methods

12.

How many Data Types are there in Java?

a)

7

b)

10

c)

8

d)

9

13.

A way for you to refer to the data when you need to retrieve or manipulate them.

a)

Access Modifiers

b)

Data type

c)

Variable

d)

Data Manipulation

14.

Used to perform operations in variables and values.

a)

Relational

b)

Arithmetic

c)

Operators

d)

Logical

15.

Data type enclosed in single quotes.

a)

Boolean

b)

Byte

c)

Character

d)

Short

16.

System.out.print("Papasa ako sa" + "MIDTERMS!"); the '+' symbol is used as?

a)

Relational Operator

b)

Concatenation Operator

c)

Logical Operator

d)

Arithmetic Operator

17.

What operator returns the truth value (Boolean; True or False)?

a)

Boolean Operator

b)

Relational Operator

c)

Logical Operator

d)

Conditional Operator

18.

What operator is used to combine multiple conditions depending on your desired results?

a)

Relational Operators

b)

Conditional Operators

c)

Arithmetic Operators

d)

Logical Operators

19.

How many decimal places does a float can contain?

a)

4 to 5

b)

6 to 7

c)

7 to 8

d)

5 to 6

20.

What do you call the nonprintable characters in Java?

a)

New Line

b)

Escape Sequences

c)

Nonprintable Characters

d)

\n

21.

To add a package, (a)   is the magic word.

22.

Escape sequences are preceded by:

(a)  

23.

What library do we use when the program needs to accept an input from the user?

a)

input

b)

scanner class

c)

Import

d)

java.util

24.

What Scanner method do we use in reading a string value from the user?

a)

nextChar()

b)

nextLine()

c)

nextInput()

d)

nextString()

25.

How many decimal places does a double can have?

a)

14

b)

17

c)

13

d)

15

26.

In Java, variable names should be composed of: (check all answers that applies)

a)

underscore

b)

dollar sign

c)

ampersand

d)

alphanumeric characters

27.

What are the symbols used in arithmetic operators?

a)

+, -, *, /, %

b)

+, -, *, /, %, ++, --

c)

+, -, *, /, %, =, ++, --, ==

d)

+, -, *, /, %, =

28.

In the following, which is NOT a Conditional Statements?

a)

if-else

b)

else-if

c)

if statement

d)

match-case

29.

What are the symbols used in logical operators?

a)

|, &, !

b)

!, &&, ||

c)

not, and, or

d)

~, ^, v

30.

for(____; ____; ____){

// Statement block } (separate your answer with a space)

(a)  

31.

immediately terminates the loop.

a)

break;

b)

return 0;

c)

exit;

d)

stop;

32.

Moves to the end of the loop

a)

end;

b)

skip;

c)

continue;

d)

break;

33.

Collection of elements of the same type.

a)

Variables

b)

Arrays

c)

List

d)

Ouch

34.

What is the Java Convention in declaration of new array?

a)

int[] array[];

b)

int array[];

c)

int array;

d)

int[] array;

35.

What allocation method is allocated during runtime?

a)

active allocation

b)

dynamic allocation

c)

runtime allocation

d)

static allocation

36.

How do we access and assign elements in an Array?

a)

initialization

b)

declaration

c)

indexing

d)

looping

37.

What do you call a loop if another loop exists in the body of a loop?

a)

Progressive Looping

b)

Nested Loops

c)

Double Loop

d)

Multiple Loop

38.

What kind of loop execute the statement in the loop first, before checking the condition?

a)

for-each

b)

do-while

c)

for

d)

while

39.

In a for-loop declaration what part checks if the loop still needs to be executed; or stopped?

a)

break

b)

condition

c)

statement

d)

if-else

40.

It performs the updates on variables used in the loop.

a)

decrement

b)

var++

c)

iterator

d)

increment

41.

Copies elements from one array to another.

a)

Ctrl + C

b)

ArrayCopy

c)

Clone

d)

Copy

42.

int num = 99;

System.out.println("num");

(a)  

43.

System.out.print("Papasa ");

System.out.print("ako!");

(a)  

44.

System.out.print("How are you \"World\"?");

(a)  

45.

boolean testExpr = ((5 + 3 == 3 + 5))

(a)  

46.

char letter = 'b', digit = '7';

boolean testExpr = !((letter == 'A' || letter == 'a') && (digit == '4' || digit <= '8'));

(a)  

47.

char letter = 'a', digit = '0';

boolean testExpr = (letter <= 97 && digit >= 48);

(a)  

48.

!FALSE

(a)  

49.

int num1 = 72, num2 = 4, rem = num1 % num2;

boolean testExpr = (rem == 12 % 7);

(a)  

50.

Papasa ba ako this midterms?

a)

Yes

b)

Opo

c)

True

d)

!False