Chapter:Classes - Declaration - Exercises

From Juneday education
Jump to: navigation, search

There are no exercises to this chapter. Please move on to the next chapter!

But you read the previous chapter text, didn't you? And you saw all the videos? And you read the "Further reading" links?

Good!

Another thing you can do is to download the two example classes from the previous page:

Compile and run the StudentDemo program. Create a student in the main class, representing yourself. Print out the reference variable to the Student and see if it works as expected. Play around with the source code for the Student class. See if you can make some changes.

$ wget https://raw.githubusercontent.com/progund/classes/master/java-classes-declaration/Student.java
$ wget https://raw.githubusercontent.com/progund/classes/master/java-classes-declaration/StudentDemo.java
$ javac StudentDemo.java && java StudentDemo

Has Rikard gotten any older, since the example on the previous page was run? TODO: Add alternative optional exercises (or write real ones)

Where to go next

The next page is: Classes_-_Packages

« PreviousBook TOCNext »