wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Revision SWC Part 1

Total questions: 35

Worksheet time: 18mins

Name
Class
Date
1.

Which of the following best defines an algorithm?

a)

A computer program written in Java

b)

A sequence of precise steps to solve a problem

c)

A flowchart for data storage

d)

A syntax rule in programming

2.

Which property ensures an algorithm eventually stops?

a)

Correctness

b)

Definiteness

c)

Finiteness

d)

Effectiveness

3.

The efficiency of an algorithm is mainly measured in terms of:

a)

Speed and accuracy

b)

Time and space

c)

Input and output

d)

Memory type

4.

Pseudocode is used to:

a)

Execute programs

b)

Plan the algorithm in human-readable form

c)

Test syntax errors

d)

Debug runtime errors

5.

Flowchart symbols are mainly used to:

a)

Represent program output only

b)

Show data types

c)

Represent program logic graphically

d)

Show code indentation

6.

Which of the following is not a control structure?

a)

Sequence

b)

Selection

c)

Repetition

d)

Definition

7.

A runtime error occurs when:

a)

The syntax is wrong

b)

The logic is incorrect

c)

The program executes but produces an unexpected issue

d)

The compiler stops due to missing semicolon

8.

Which of the following is not a principle of OOP?

a)

Polymorphism

b)

Modularity

c)

Compilation

d)

Inheritance

9.

Which concept in OOP is about hiding internal details and exposing only necessary information?

a)

Encapsulation

b)

Abstraction

c)

Modularity

d)

Polymorphism

10.

In Java, an object is created using:

a)

create new Object()

b)

Object obj = Object();

c)

Object obj = new Object();

d)

Object = new()

11.

The keyword void in Java means:

a)

Function returns a string

b)

Function does not return any value

c)

Function ends immediately

d)

Function is private

12.

Which of the following is a reference data type?

a)

int

b)

double

c)

Array

d)

char

13.

Wrapper classes are used to:

a)

Convert primitive types into objects

b)

Store multiple values in a single variable

c)

Run methods faster

d)

Debug logic errors

14.

Example of wrapper class for int:

a)

Number

b)

IntClass

c)

Integer

d)

WrapperInt

15.

The if-else and switch statements are examples of:

a)

Repetition control

b)

Sequence control

c)

Selection control

d)

Conditional loops

16.

Which loop repeats until a condition is no longer true?

a)

while loop

b)

if-else statement

c)

switch statement

d)

case control

17.

Recursion refers to:

a)

Repeating instructions using loops

b)

A function calling itself to solve a smaller problem

c)

Data stored in arrays

d)

A function with no parameters

18.

In recursion, the base case means:

a)

The point where recursion starts

b)

The stopping condition of recursion

c)

The function’s first line

d)

The loop condition

19.

What will happen if there is no base case in a recursive function?

a)

Compilation error

b)

Infinite recursion → stack overflow

c)

The function will stop automatically

d)

It becomes iterative

20.

Which OOP concept allows objects to take multiple forms?

a)

Inheritance

b)

Encapsulation

c)

Polymorphism

d)

Abstraction

21.

Which interface forms the root of the Java Collections Framework hierarchy?

a)

Set

b)

List

c)

Map

d)

Collection

22.

Which keyword is used to inherit a class in Java?

a)

inherit

b)

super

c)

extends

d)

implements

23.

Which Java class provides dynamic array functionality?

a)

Vector

b)

Array

c)

ArrayList

d)

LinkedList

24.

A list refers to:

a)

A non-linear collection of data

b)

A linear collection of data that allows duplicates

c)

A fixed collection with no duplicate elements

d)

A random access structure only for unique values

25.

The major drawback of using arrays in Java is:

a)

Arrays can only hold integers

b)

Array size is fixed at compile time

c)

Arrays cannot hold duplicate elements

d)

Arrays are slower than lists

26.

When you remove an element from an Array, what happens?

a)

The size decreases automatically

b)

The removed slot becomes empty or null

c)

The array shifts elements automatically

d)

The array deletes itself

27.

When you remove an element from a List (like ArrayList):

a)

The slot remains empty

b)

The following elements shift left automatically

c)

The list size stays the same

d)

The program must be restarted

28.

The head of a list refers to:

a)

The last element

b)

The middle element

c)

The first element

d)

The element with the largest value

29.

In Java, List is:

a)

A class

b)

A package

c)

An interface

d)

A primitive data type

30.

What happens when the capacity of an ArrayList is exceeded?

a)

It throws an error

b)

It automatically enlarges

c)

It deletes the oldest data

d)

It becomes read-only

31.

Which is faster for frequent insertions and deletions?

a)

ArrayList

b)

LinkedList

c)

Vector

d)

Stack

32.

What is an iterator in a linked list?

a)

A node storing data

b)

A pointer marking current position

c)

The first node

d)

A data container

33.

In a doubly linked list, each node contains:

a)

Only next link

b)

Next and previous links

c)

Two data values only

d)

Head and tail markers

34.

What is the main advantage of a doubly linked list?

a)

Simpler structure

b)

Less memory usage

c)

Easy traversal in both directions

d)

Faster random access

35.

In a circular linked list, the last node’s next pointer points to:

a)

The tail

b)

The head node

c)

null

d)

A random node