public class StringExample { public static void main(String[] args) { // create text object TextInput tin = new TextInput(); // prompt for input System.out.print("What is your name? "); // retrieve line of input String name = tin.readLine(); // obtain first character char ch = name.charAt(0); // append a blank String initial = ch + " "; // convert to uppercase initial = initial.toUpperCase(); // obtain first character String temp1 = initial.substring(0,1); // obtain rest of characters String temp2 = name.substring(1,name.length()); // remove spaces at front and back temp2 = temp2.trim(); // output System.out.println("Hello " + temp1 + temp2); } }