| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
hard Solved by 26 students
String Manipulation With Substring
< Prev
Next >

Consider the following method.

public static String scramble(String word, int howFar)
{
    return word.substring(howFar + 1, word.length()) + 
           word.substring(0, howFar);
}

What value is returned by the call scramble("compiler", 3)?

A

“ilercomp”

B

“ilercom”

C

“pilercom”

D

“compiler”

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1hiboyshello11 0m 00s 100
#2varunrajaram111 0m 00s 100
#3y.seong202711 1m 02s 38
#4bommasam00011 1m 17s 23
#5kazvin.tjakradinata12 1m 14s 16
#6alchemax04311 1m 38s 2
#7lsj0803092212 1m 35s -5
#8angelajxi1101 0m 00s -10
#9michael.2103ll01 0m 00s -10
#10testdsadasd01 0m 01s -11
Items per page:
10
1 – 10 of 21
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy