Activities
If all this talk of viruses didn't make you sick, you can increase your knowledge of this hour's topics with the following activity:
- Add a private variable to the Virus class that stores an integer called newSeconds. Create methods to return the value of newSeconds and change the value of newSeconds only if the new value is between 60 and 100.
- Write a Java app that takes an argument as a string, converts it to a float variable, converts that to a Float object, and finally turns that into an int variable. Run it a few times with different arguments to see what results.
To see Java programs that implement these activities, visit the tutorial's website at http://www.java24hours.com.
|