wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CC102- Final Examination_2025

Total questions: 50

Worksheet time: 25mins

Name
Class
Date
1.

It is a sequence of characters.

a)

Character

b)

String

c)

Interger

d)

Array

2.

It is a class is used to create a string object.

a)

java.io.String

b)

java.util.String

c)

java.lang.String

d)

java.cl.String

3.

Java String literal is created by using______________.

a)

single quotes

b)

double quotes

c)

square brackets

d)

curly brace brackets

4.

It is typically called an “escape” character in the sense that it is used to “escape” the usual meaning of the following character.

a)

Asterisk

b)

curly brace brackets

c)

plus sign

d)

Backslash

5.

A class is used to create mutable (modifiable) string.

a)

Java String

b)

Java StringBuilder

c)

Java StringBuffer

d)

Java StringBuller

6.

A method concatenates the given argument with this string.

a)

StringBuilder replace()

b)

StringBuilder insert()

c)

StringBuilder append()

d)

StringBuilder delete()

7.

A method inserts the given string with this string at the given position.

a)

StringBuilder replace()

b)

StringBuilder insert()

c)

StringBuilder append()

d)

StringBuilder delete()

8.

It is a multiple data items of the same data type, in a contiguous block of memory, divided into a number of slots.

a)

Array

b)

String

c)

Character

d)

Integer

9.

It is a field of an array that returns the size of the array.

a)

Array Capacity

b)

Array Index

c)

Array Number

d)

Array Length

10.

It returns char value for the particular index.

a)

int intAt(int index)

b)

char intAt(int index)

c)

int charAt(int index)

d)

char charAt(int index)

11.

To declare an array, write the data type, followed by a set of__________.

a)

curly brackets{}

b)

backslash\

c)

square brackets[]

d)

equal sign=

12.

A 2D array has a type such as int or String, with two pairs of ________________.

a)

curly brackets{}

b)

backslash\

c)

square brackets[]

d)

equal sign=

13.

It's also possible to create an array of arrays known as _______________.

a)

multidimensional array

b)

single array

c)

5D array

d)

4D array

14.

Select one of the two ways to create a String object.

a)

By new keyword

b)

By new String

c)

By keyword

d)

By another keyword

15.

It is used to create string object to make Java more memory efficient because no new objects are created if it exists already in the string constant pool.

a)

By new keyword

b)

By new String

c)

By string literal

d)

By another keyword

16.

It allows us to redirect the flow of program execution.

a)

Return Statement

b)

Control Statement

c)

Branching Statement

d)

Array Statement

17.

It is used to exit from the current method.

a)

Branching Statement

b)

Return Statement

c)

Control Statement

d)

Array Statement

18.

It allows the execution of the same code a number of times.

a)

For loop

b)

If Statement

c)

Switch Statement

d)

Return Statement

19.

It is used to terminate a sequence in a switch statement or to exit a loop.

a)

Break Statement

b)

Return Statement

c)

Continue Statement

d)

Branching Statement

20.

It is executed several times as long as the condition is satisfied.

a)

If - Else Condition

b)

Branching Statement

c)

Do – while Loop

d)

Termination Statement

21.

It is used when we want to execute a certain statement if a condition is true, and a different statement if the condition is false.

a)

If - Else Statement

b)

Branching Statement

c)

Do – while Statement

d)

Termination Statement

22.

It compares the loop variable to some limit value.

a)

Initialization

b)

Java Package

c)

Loop Condition

d)

Control Statement

23.

It is a statement or block of statements that is repeated as long as some condition is satisfied.

a)

Continue Statement

b)

While loop

c)

Return Statement

d)

Break Statement

24.

It is a java statement that allows us to execute specific blocks of code a number of times.

a)

Decision control structures

b)

Array control structures

c)

Repetition control structures

d)

String control structures

25.

It initializes the loop variable.

a)

Loop Condition

b)

Repetition Expression

c)

Initialization Expression

d)

Boolean Expression

26.

This statement should evaluate to a boolean value that means that the execution of the condition should either result to a value of true or a false.

a)

Loop Condition

b)

Repetition Expression

c)

Initialization Expression

d)

Boolean Expression

27.

It allows us to select specific sections of code to be executed.

a)

Repetition control structures

b)

Decision control structures

c)

Algorithm control structures

d)

String control structures

28.

When a switch is encountered, java first evaluates the switch_expression and jumps to the case whose selector matches the value of the expression.

a)

True

b)

False

29.

Always place the statement or statements of an if or if-else block inside brackets {}.

a)

True

b)

False

30.

In nested if-else blocks, you can have other if-else blocks inside another if-else block.

a)

True

b)

False

31.

It is a method which take a string (input) as an argument and convert in other formats.

a)

Parse Method

b)

Parse Int ()

c)

Parse Double

d)

Parse Float

32.

In Java allow us to pass arguments during the execution of the program. As the name suggests arguments are passed through the command line.

a)

Command-line Arguments

b)

Supported UDF

c)

Numeric Command-Line Arguments

d)

Parse Method

33.

In Java and other programming languages, there is one capability wherein we can use one variable to store a list of data and manipulate them more efficiently. This type of variable is called.

a)

Array Length

b)

Arrays

c)

Java Ray

d)

Multidimensional Arrays

34.

It dictate how the values are produced or computed.

a)

Java Operators

b)

Java Expressions

c)

Assignment Operators

d)

Relational Operators

35.

Using this model, we can set our own function as per our requirement.

a)

Java Functions

b)

User Defined Function

c)

Assignment Operators

d)

Relational Operators

36.

The main() method of every Java program only accepts string arguments.

a)

True

b)

False

37.

To compile the java code in command line, you will type the word "javac"

a)

True

b)

False

38.

Java String class cannot provides a lot of methods to perform operations on strings such as compare(), concat(), equals(), split(), length(), replace(), compareTo(), intern(), substring() etc.

a)

True

b)

False

39.

It accepts string arguments, hence it is not possible to pass numeric arguments through the command line

a)

String [] args

b)

Class

c)

Void

d)

Main

40.

A sign that use to connect two string in Java is

a)

&&

b)

$

c)

%

d)

+

41.

What will be the output? Consider the following Java code: public class example { static void myMethod() { System.out.println("I just got executed!"); } public static void main(String[] args) { myMethod(); } }

a)

I just got executed!

b)

I just got executed! I just got executed!

c)

Nothing

d)

I just got executed! myMethod();

42.

What will be the output? Consider the following Java code: public class JavaStringMethods { public static void main(String[] args) { char [] ch = {'j','a','v','a','t','p','o','i','n','t'}; String s = new String(ch); System.out.println(s); } }

a)

javatpoint

b)

None

c)

ch

d)

'j'a'v'a't'p'"oi"'nt'

43.

JOEY becomes JY what StringBuilder method use?

a)

StringBuilder append() method

b)

StringBuilder insert() method

c)

StringBuilder replace() method

d)

StringBuilder delete() method

44.

JOEY becomes YEOJ what StringBuilder method use?

a)

StringBuilder append() method

b)

StringBuilder reverse() method

c)

StringBuilder replace() method

d)

StringBuilder delete() method

45.

int [] a = new int [5]; In this initialization what do you call the [5]?

a)

Type

b)

Array name

c)

Dimension

d)

Array length

46.

int[][] a = new int[3][4]; in this initialization what do you call the [3]?

a)

Nothing

b)

Column

c)

Row

d)

Array Value

47.

What will be the output? Mark only one oval. public class StringBuilderAppend { public static void main(String[] args) { StringBuilder sb = new StringBuilder("Hello"); sb.append(" Java"); System.out.println(sb); } }

a)

Nothing

b)

Hello

c)

Hello Java

d)

Java

48.

What will be the output? Mark only one oval. public class example { public static void main (String[] args) throws Exception { StringBuilder ab = new StringBuilder("Hello "); ab.replace(1, 3, "Java"); System.out.println(ab); } }

a)

HJavalo

b)

HJavaello

c)

Hello Java

d)

Java

49.

int[] age = {12, 4, 5, 2, 25}; What is the index number of 12?

a)

age [0];

b)

age [1];

c)

age [2];

d)

age [3];

50.

int[][] age = {12, 4, 5, 2, 25}, {8, 14, 18 32, 75}; What is the array lenght of this?

a)

age [2][5];

b)

age [1][10];

c)

age [5][2];

d)

age [1][4];