
Java Strings worksheet #3 Name- Period Show the output of the following code segments. If an error occurs, print “error” as your answer& explain. Surround your answers with double quotes. 1. String message”abcdefghijklm” String sub message.substring (3, 4) System.out.println (sub); 2. System.out.println (“zyxwvuts” .substring (4)) String digits1234567890″ int pos = digits. indexOf(“6”); System.out.println (pos + digits.indexof (“a”)) -“ilovemydog” String dog String dog2 dog. substring (7) System.out.println (dog2) string phrase = “ilovemydog”; int pos phrase.