Lecture 4: Exercises
The main purpose of this exercise session is to learn how to create loops and branching statements.
1. Create new project
Open eclipse and choose "File->New->Project...". You could appropriately call the project "lecture3".
You will need to download and copy the SimpleAnimationApplet2.java into your directory for the last exercise.
For each of the execises below you need to crete a new class with a main method.Create a new class by clicking the "c+" icon.
2. Programming exercises
Exercise 3.5 to 3.7
Note that in both exercise 3.6 and 3.7 eclipse will show a warning that "The serializable class MyApplet does not declare a static final
serialVersionUID field of type long"
This can be fixed either by yourself adding the line "private static final long serialVersionUID = 1L;" right below the class definition or by clicking the error message and selecting "Add default serial versionID".
Answer point 6 through 12 of the Quiz for Chapter 3 on page 114.