Write code to take a String input from the user, then print the first and last letters of the string on one line. code example
Example: check last character of string java
String str = "India";
System.out.println("last char = " + str.charAt(str.length() - 1));