Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

4thQuarter Review Comprog 2

Total questions: 20

Worksheet time: 15mins

Name
Class
Date
1.

What is the purpose of Java data types?

a)

To manage memory allocation

b)

To define the structure of a class

c)

To specify the type of data a variable can hold

d)

To create user interfaces

2.

Which of the following is a primitive data type in Java?

a)

String

b)

int

c)

Object

d)

ArrayList

3.

What does the 'final' keyword indicate in Java?

a)

The variable can be changed

b)

The variable is an instance variable

c)

The variable cannot be changed once assigned

d)

The variable is static

4.

Which keyword is used to handle exceptions in Java?

a)

throw

b)

catch

c)

try

d)

All of the above

5.

What is encapsulation in OOP?

a)

Hiding complex details

b)

Bundling data with methods

c)

Acquiring properties of another class

d)

Changing method behavior

6.

Which of the following is NOT a control flow keyword in Java?

a)

if

b)

for

c)

while

d)

class

7.

Which of the following is a non-primitive data type?

a)

char

b)

boolean

c)

String

d)

int

8.

What does the 'static' keyword signify?

a)

Cannot be changed

b)

Belongs to the instance

c)

Is an abstract method

d)

Belongs to the class

9.

What is the role of a debugger in an IDE?

a)

To compile code

b)

To find and fix errors

c)

To manage versions

d)

To write code

10.

Which of the following is a feature of Integrated Development Environments (IDEs)?

a)

Network Configuration

b)

Web Hosting

c)

Database Management

d)

Code Editor

11.

What is the purpose of version control?

a)

To write documentation

b)

To debug applications

c)

To compile code

d)

To track code changes

12.

Which of the following is an example of a high-level programming language?

a)

Assembly Language

b)

Machine Language

c)

Java

d)

Binary Code

13.

What is the main function of a compiler?

a)

Translates entire code before running

b)

Formats the code

c)

Translates code line by line

d)

Debugs the code

14.

Which of the following IDEs is specifically for Python?

a)

Eclipse

b)

NetBeans

c)

PyCharm

d)

Visual Studio Code

15.

What is the purpose of code autocompletion?

a)

To debug the code

b)

To compile the code

c)

To suggest code as you type

d)

To format the code

16.

What is a breakpoint in debugging?

a)

A point where code starts

b)

A point where code is compiled

c)

A point where code execution stops

d)

A point where errors are logged

17.

Which of the following is NOT a Java keyword?

a)

method

b)

public

c)

class

d)

static

18.

What does the 'char' data type store?

a)

An integer

b)

A string of characters

c)

A boolean value

d)

A single character

19.

What is the role of an interface in Java?

a)

To handle exceptions

b)

To provide a blueprint for classes

c)

To define a class

d)

To create objects

20.

Which of the following is a feature of object-oriented programming?

a)

Encapsulation

b)

Compilation

c)

Debugging

d)

Execution