B4 - More about Strings

B4 - More about Strings

University

16 Qs

quiz-placeholder

Similar activities

Intro C++

Intro C++

University

12 Qs

VOIDABLE CONRACTS PART 2

VOIDABLE CONRACTS PART 2

University

12 Qs

HAZMAT

HAZMAT

University

12 Qs

GNED 14: PRACTICE EXAM

GNED 14: PRACTICE EXAM

University

15 Qs

QUIZ 1

QUIZ 1

University

15 Qs

AIRC 1004 Exam 2 Review

AIRC 1004 Exam 2 Review

University

20 Qs

BUKBER KANDATEL BATURAJA - Maret 2024

BUKBER KANDATEL BATURAJA - Maret 2024

University

15 Qs

Air Cargo Management 01

Air Cargo Management 01

University

20 Qs

B4 - More about Strings

B4 - More about Strings

Assessment

Quiz

Other

University

Practice Problem

Easy

Created by

Ahmetcan türk

Used 7+ times

FREE Resource

AI

Enhance your content in a minute

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

16 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following write?

String str = "Hello World!" ;

str.substring(6);

System.out.println( str );

World!

Hello

Hello World!

The fragment will not compile.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String str = "Hello World!" ;

System.out.println( str.substring(6) );

What will it write?

World!

Hello

Hello World!

The fragment will not compile.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String str = "Hello World!" ;

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

What will it write?

0

10

11

12

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String myString = "";

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

What what will it write?

0

1

2

the code will not compile

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String str = "Hello\tWorld!" ;

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

What will it write?

0

10

11

12

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String str = "Hello World!" ;

What is the index of the character 'W' ?

0

5

6

7

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Examine this code:

String str = "One Fine Day" ;

String val = str.substring(4) ;

System.out.println( val );

What does the fragment print?

One Fine Day

Fine Day

Day

One Fine

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?