Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
Java Language EssentialsDownload tutorial zip fileEmail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
Exercises
  


7. MusicStore with an Owner: Tasks page 20 of 31


For this exercise you add an owner instance variable and the method setOwner() to MusicStore.

For more help with exercises, see About The Exercises

PrerequisitesSkeleton Code

Tasks

  • Task 1

    Add the instance variable owner to MusicStore. The data type should be String and the initial value should be "No owner.", or something similar.

  • Task 2

    Add the method setOwner() to MusicStore. This method should set the instance variable owner to whatever String value is passed as an argument.

  • Task 3

    Add functionality to TestMusicStore to set the store owner's name.

  • Task 4

    Compile the source code for MusicStore and TestMusicStore.

  • Task 5

    Execute TestMusicStore.

Help for each of these tasks can be found on the next page.


copyright 1996-2000 Magelang Institute dba jGuru


Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
PrivacyLegalContact