Java String Quiz

Java String Quiz

1st Grade - University

20 Qs

quiz-placeholder

Similar activities

Java Programming

Java Programming

University

20 Qs

Java Code Snippets Quiz 1

Java Code Snippets Quiz 1

10th Grade

22 Qs

The String Class

The String Class

12th Grade

20 Qs

Basic Java Quiz

Basic Java Quiz

University

15 Qs

Java, part I

Java, part I

11th Grade - University

20 Qs

Code Junction 4

Code Junction 4

University

20 Qs

AP CSA Unit One Review

AP CSA Unit One Review

11th Grade

23 Qs

Java March

Java March

KG - University

16 Qs

Java String Quiz

Java String Quiz

Assessment

Quiz

Computers

1st Grade - University

Medium

Created by

M. R.

Used 17+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the type of objects that can store a sequence of characters in Java?

Character

String

Array

Text

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used for both addition and concatenation in Java?

/

-

*

+

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a string using the new keyword in Java?

String str = new String[];

String str = String.new();

String str = new String("");

String str = new String();

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What escape character is used to insert a double quote in a string?

\"

\'

\\

\n

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the result of the following code:

String x = "50";

int y = 20;

String z = x + y;

50.20

50

5020

70

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which escape sequence represents a new line in Java?

\b

\r

\t

\n

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code:

String str = "Hello";

System.out.println(str.length());

5

4

Null

6

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?