Java String Quiz

Java String Quiz

1st Grade - University

20 Qs

quiz-placeholder

Similar activities

Dasar Komputer

Dasar Komputer

10th Grade

23 Qs

COMPUTER TEST

COMPUTER TEST

1st - 7th Grade

20 Qs

3D printing Grade 5

3D printing Grade 5

5th Grade

16 Qs

Text and Image representation

Text and Image representation

11th Grade

22 Qs

CLASS 1 THE MOUSE

CLASS 1 THE MOUSE

1st - 2nd Grade

20 Qs

PHP First Internal Practical Viva

PHP First Internal Practical Viva

University

20 Qs

Assessment 08

Assessment 08

University

15 Qs

Operating System

Operating System

12th Grade

17 Qs

Java String Quiz

Java String Quiz

Assessment

Quiz

Computers

1st Grade - University

Practice Problem

Medium

Created by

M. R.

Used 17+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?