id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > dec1_2017_APSLHL_swap
prev  |  next  |  chance

Write a method that accepts a string parameter and returns the string with its first and last characters swapped. You may assume the string has at least two characters. The ONLY string methods you may use are .length, .substring, .charAt, and .equals. You do not have to use all of these string methods. You may also use any NON-string methods and operations.


dec1_2017_APSLHL_swap("xyz") → "zyx"
dec1_2017_APSLHL_swap("abcdefg") → "gbcdefa"
dec1_2017_APSLHL_swap("qw") → "wq"

...Save, Compile, Run (ctrl-enter)

public String dec1_2017_APSLHL_swap(String str) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 290

Copyright Nick Parlante 2017 - privacy