Question
/** * * @param str: assume it contains at least one character * @return the last character in the String */ public char getLastChar(String str)
/** * * @param str: assume it contains at least one character * @return the last character in the String */ public char getLastChar(String str) { return 0; //'a' used as default value (to be completed) }
/** * * @param str: assume it contains at least one character * @return the String with the first character removed */ public String getWithoutFirstChar(String str) { return ""; //to be completed } /** * * @param str: assume it contains at least one character * @return the String with the last character removed */ public String getWithoutLastChar(String str) { return ""; //to be completed }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started