I need to get the last character of the last input string. I wrote a piece of code that gets the last letter of the first string:
public class LastCharacter { public static void main(String[] args) { String string = args[0]; System.out.println("last character: " + string.substring(string.length() -1)); } } How can I get the last character of the last string parameter?
String string = args[args.length-1];, assuming thatargs.length >= 1.