NEW
Font size
WorksheetsCC102- Final Examination_2025
Total questions: 50
Worksheet time: 25mins
It is a sequence of characters.
Character
String
Interger
Array
It is a class is used to create a string object.
java.io.String
java.util.String
java.lang.String
java.cl.String
Java String literal is created by using______________.
single quotes
double quotes
square brackets
curly brace brackets
It is typically called an “escape” character in the sense that it is used to “escape” the usual meaning of the following character.
Asterisk
curly brace brackets
plus sign
Backslash
A class is used to create mutable (modifiable) string.
Java String
Java StringBuilder
Java StringBuffer
Java StringBuller
A method concatenates the given argument with this string.
StringBuilder replace()
StringBuilder insert()
StringBuilder append()
StringBuilder delete()
A method inserts the given string with this string at the given position.
StringBuilder replace()
StringBuilder insert()
StringBuilder append()
StringBuilder delete()
It is a multiple data items of the same data type, in a contiguous block of memory, divided into a number of slots.
Array
String
Character
Integer
It is a field of an array that returns the size of the array.
Array Capacity
Array Index
Array Number
Array Length
It returns char value for the particular index.
int intAt(int index)
char intAt(int index)
int charAt(int index)
char charAt(int index)
To declare an array, write the data type, followed by a set of__________.
curly brackets{}
backslash\
square brackets[]
equal sign=
A 2D array has a type such as int or String, with two pairs of ________________.
curly brackets{}
backslash\
square brackets[]
equal sign=
It's also possible to create an array of arrays known as _______________.
multidimensional array
single array
5D array
4D array
Select one of the two ways to create a String object.
By new keyword
By new String
By keyword
By another keyword
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.
By new keyword
By new String
By string literal
By another keyword
It allows us to redirect the flow of program execution.
Return Statement
Control Statement
Branching Statement
Array Statement
It is used to exit from the current method.
Branching Statement
Return Statement
Control Statement
Array Statement
It allows the execution of the same code a number of times.
For loop
If Statement
Switch Statement
Return Statement
It is used to terminate a sequence in a switch statement or to exit a loop.
Break Statement
Return Statement
Continue Statement
Branching Statement
It is executed several times as long as the condition is satisfied.
If - Else Condition
Branching Statement
Do – while Loop
Termination Statement
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.
If - Else Statement
Branching Statement
Do – while Statement
Termination Statement
It compares the loop variable to some limit value.
Initialization
Java Package
Loop Condition
Control Statement
It is a statement or block of statements that is repeated as long as some condition is satisfied.
Continue Statement
While loop
Return Statement
Break Statement
It is a java statement that allows us to execute specific blocks of code a number of times.
Decision control structures
Array control structures
Repetition control structures
String control structures
It initializes the loop variable.
Loop Condition
Repetition Expression
Initialization Expression
Boolean Expression
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.
Loop Condition
Repetition Expression
Initialization Expression
Boolean Expression
It allows us to select specific sections of code to be executed.
Repetition control structures
Decision control structures
Algorithm control structures
String control structures
When a switch is encountered, java first evaluates the switch_expression and jumps to the case whose selector matches the value of the expression.
True
False
Always place the statement or statements of an if or if-else block inside brackets {}.
True
False
In nested if-else blocks, you can have other if-else blocks inside another if-else block.
True
False
It is a method which take a string (input) as an argument and convert in other formats.
Parse Method
Parse Int ()
Parse Double
Parse Float
In Java allow us to pass arguments during the execution of the program. As the name suggests arguments are passed through the command line.
Command-line Arguments
Supported UDF
Numeric Command-Line Arguments
Parse Method
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.
Array Length
Arrays
Java Ray
Multidimensional Arrays
It dictate how the values are produced or computed.
Java Operators
Java Expressions
Assignment Operators
Relational Operators
Using this model, we can set our own function as per our requirement.
Java Functions
User Defined Function
Assignment Operators
Relational Operators
The main() method of every Java program only accepts string arguments.
True
False
To compile the java code in command line, you will type the word "javac"
True
False
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.
True
False
It accepts string arguments, hence it is not possible to pass numeric arguments through the command line
String [] args
Class
Void
Main
A sign that use to connect two string in Java is
&&
$
%
+
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(); } }
I just got executed!
I just got executed! I just got executed!
Nothing
I just got executed! myMethod();
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); } }
javatpoint
None
ch
'j'a'v'a't'p'"oi"'nt'
JOEY becomes JY what StringBuilder method use?
StringBuilder append() method
StringBuilder insert() method
StringBuilder replace() method
StringBuilder delete() method
JOEY becomes YEOJ what StringBuilder method use?
StringBuilder append() method
StringBuilder reverse() method
StringBuilder replace() method
StringBuilder delete() method
int [] a = new int [5]; In this initialization what do you call the [5]?
Type
Array name
Dimension
Array length
int[][] a = new int[3][4]; in this initialization what do you call the [3]?
Nothing
Column
Row
Array Value
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); } }
Nothing
Hello
Hello Java
Java
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); } }
HJavalo
HJavaello
Hello Java
Java
int[] age = {12, 4, 5, 2, 25}; What is the index number of 12?
age [0];
age [1];
age [2];
age [3];
int[][] age = {12, 4, 5, 2, 25}, {8, 14, 18 32, 75}; What is the array lenght of this?
age [2][5];
age [1][10];
age [5][2];
age [1][4];
