Java Substring 10.18

Java Substring 10.18

10th Grade

11 Qs

quiz-placeholder

Similar activities

G10_C++_Arrays

G10_C++_Arrays

9th - 11th Grade

12 Qs

Пітон. Списки.

Пітон. Списки.

9th - 10th Grade

12 Qs

اختبار ثالثة إعدادي - مسار مصري - على الفصل الأول

اختبار ثالثة إعدادي - مسار مصري - على الفصل الأول

3rd Grade - University

14 Qs

Programming with C++

Programming with C++

9th - 12th Grade

10 Qs

8.12 C++ Test on Classes

8.12 C++ Test on Classes

9th - 12th Grade

15 Qs

Programming basics

Programming basics

10th - 11th Grade

11 Qs

Thao tác với tệp

Thao tác với tệp

10th - 11th Grade

10 Qs

Graphics Programming Review

Graphics Programming Review

8th - 10th Grade

10 Qs

Java Substring 10.18

Java Substring 10.18

Assessment

Quiz

Computers

10th Grade

Practice Problem

Hard

Created by

Arasaka Teacher

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String str = "level nail";

System.out.println(str.substring(a,b) + str.substring(c));

Which values of a, b, and c will cause the program to output the word "evil"?

a=1 b=3 c=8

a=0 b=2 c=7

a=1 b=2 c=8

a=1 b=3 c=7

a=2 b=4 c=9

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

String s1 = "California Golden Bears";

String s2 = s1.substring(11, 13) +  s1.substring(10, 11) + s1.substring(18) + "!";

What is the value of s2 after the code executes?

"Go Bears!"

"GoBears!"

" Gaa!"

"Go B!"

"Gol Bears!"

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of pos after the following code executes?

String s1 = "abccba";

int pos = s1.indexOf("b");

2

1

4

-1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of len after the following code executes?

String s1 = "baby";

int len = s1.length();

2

3

4

-1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of s2 after the following code executes?

String s1 = "baby";

String s2 = s1.substring(0, 3);

baby

b

ba

bab

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of len after the following code executes?

String s1 = "Miss you!";

int len = s1.length();

7

8

9

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the value of s2 after the following code executes?

String s1 = "baby";

String s2 = s1.substring(2);

by

aby

a

b

ba

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?

Discover more resources for Computers