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

 

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

Write a method that returns a string stating what the last character in the input-parameter string is. If the input-parameter string is empty, return "empty", otherwise return "last: #" where # represents the last character in the input-parameter string. If you STILL don't understand, look at the test data.


oct23_2017_APSLHL_getLast("testing") → "last: g"
oct23_2017_APSLHL_getLast("Wow!") → "last: !"
oct23_2017_APSLHL_getLast("") → "empty"

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

public String oct23_2017_APSLHL_getLast(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: 250

Copyright Nick Parlante 2017 - privacy