Exercises
1. Which of the following are invalid names? Why?
Int playNextSong 6_05_calloc Xx alphaBetaRoutineclearScreen _1312 zReInitialize _ A$
2. Based on the example of the car in this chapter, think of an object you use every day. Identify a class for that object and write five actions you do with that object.
3. Given the list in exercise 2, use the following syntax to rewrite your list in this format:
[instance method];
4. Imagine that you own a boat and a motorcycle in addition to a car. List the actions you perform with each of these. Do you have any overlap between these actions?
5. Based on question 4, imagine that you have a class called Vehicle and an object called ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access