Sams Teach Yourself Java™ in 24 Hours (Covering Java 7 and Android)

(singke) #1
ptg7068951

Workshop 77

Activities


Yo u c a n r e v i e w t h etopics of this hour more fully with the following activities:


. Write a short Java program called Favoritethat puts the code from
this hour’s “Comparing Two Strings” section into the main()block
statement. Test it out to make sure it works as described and says that
Ada’s favorite instrument is not the ukulele. When you’re done,change
the initial value of the guessvariable from ukuleletopiano. See what
happens.
. Modify the Creditsprogram so the names of the director and all per-
formers are displayed entirely in uppercase letters.


To s e e J av a p r o g r a m s t h a t i m p l e m e n t t h e s e a c t i v i t i e s ,visit the book’s website
at http://www.java24hours.com.

Free download pdf