Java Substring 10.18

Java Substring 10.18

10th Grade

11 Qs

quiz-placeholder

Similar activities

Nhanh như chớp 11C1

Nhanh như chớp 11C1

9th - 12th Grade

6 Qs

Java String Methods

Java String Methods

9th - 12th Grade

7 Qs

Bài 24-Xâu kí tự

Bài 24-Xâu kí tự

10th Grade

10 Qs

Python set

Python set

10th Grade

12 Qs

Xâu kí tự

Xâu kí tự

10th Grade

10 Qs

Java Code Questions

Java Code Questions

9th - 12th Grade

10 Qs

APCSA Unit 9

APCSA Unit 9

10th - 12th Grade

8 Qs

String Manipulation Quiz

String Manipulation Quiz

10th - 11th Grade

10 Qs

Java Substring 10.18

Java Substring 10.18

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Arasaka Teacher

Used 1+ times

FREE Resource

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

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?