2016-09-30 HW08

posted Sep 30, 2016, 6:43 AM by Samuel Konstantinovich   [ updated Sep 30, 2016, 2:49 PM ]
Strings!

Homework:
Edit:530pm (Due to no loops, HW was modified)

Read the java Documentation for the 7 methods we talked about:
1 charAt(int)
2 length()
3 equals(String)
4 compareTo(String)
5 indexOf(String)
6 substring(int,int)
7 substring(int)
Pay attention to when they throw exceptions, and when they return special values.

Here is the AP subset of Java you need to know:
Strings are here:

Write a StringDemo class, that just contains a main.
In that main, write a set of examples of each of the 7 methods that work. 
Mess around with the working examples, to generate compile time errors or runtime errors (exceptions).

Copy/Paste 5 different errors, Explain what they mean, how you can find it in your code, and how you can recognize what to do in the future. Notice things like line numbers in the error messages!

Submit a digital copy by Wed 8am on the HW server.

Include the entire error, but if you make one change that causes other errors, just paste the 1st error.


Comments