Java String Quiz

Java String Quiz

1st Grade - University

20 Qs

quiz-placeholder

Similar activities

Java Array

Java Array

University

23 Qs

Unit 10 Recursion Review

Unit 10 Recursion Review

9th - 12th Grade

20 Qs

Java Array

Java Array

University

21 Qs

CSA Lessons 1 - 4

CSA Lessons 1 - 4

10th - 12th Grade

15 Qs

Array

Array

12th Grade

20 Qs

POS - Prelim Examination

POS - Prelim Examination

University

20 Qs

Soal Java

Soal Java

11th Grade - University

15 Qs

Programming Java

Programming Java

University

20 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?