Strings quiz

Strings quiz

Professional Development

10 Qs

quiz-placeholder

Similar activities

04 JavaScript Einführung

04 JavaScript Einführung

Professional Development

10 Qs

Operating Systems

Operating Systems

Professional Development

12 Qs

PreTrainingClassesObjectsMethods

PreTrainingClassesObjectsMethods

Professional Development

10 Qs

Python Data Structures & Statements

Python Data Structures & Statements

Professional Development

11 Qs

Python Collections Quiz

Python Collections Quiz

Professional Development

12 Qs

introduction to visual programming

introduction to visual programming

Professional Development

8 Qs

AppsLab_Q3

AppsLab_Q3

1st Grade - Professional Development

12 Qs

Cloud Computing

Cloud Computing

Professional Development

10 Qs

Strings quiz

Strings quiz

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

Ms STAFF

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output?

String s1 = "hello";

String s2 = "hel" + "lo";

System.out.println(s1 == s2);

true

false

compile time error

runtime error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following return?

String s1 = "hello";

String s2 = "hel";

String s3 = s2 + "lo";

System.out.println(s1 == s3);

true

false

compile time error

runtime error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output?

String s = "Java";

s.concat("World");

System.out.println(s);

JavaWorld

Java

World

Compiler error

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the code?

String str1 = new String("Test");

String str2 = str1.intern();

System.out.println(str1 == str2);

true

false

compiler error

runtime error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method removes whitespace from both ends of a string?

removeWhiteSpace()

strip()

trim()

deleteSpace()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does String.valueOf(123) return?

123 as int

123.0

"123"

Compilation error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will this print?

String s = " ";

System.out.println(s.isBlank());

true

false

compiler error

exception

Access all questions and much more by creating a free account

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

Already have an account?