Skip to content

Instantly share code, notes, and snippets.

@johnmcc
Created November 20, 2018 15:04
Show Gist options
  • Save johnmcc/e8e334abda031192e002c2c61983b500 to your computer and use it in GitHub Desktop.
Save johnmcc/e8e334abda031192e002c2c61983b500 to your computer and use it in GitHub Desktop.

Polymorphism - Minilab

  • create an 'InternetRadio' class which implements the IConnect interface and be able to add an instance to Network
  • make the radio be able to tune to a station
  • give the Network a maximum number of items that can be connected to it
  • add a method to our Network to tell how many many free connection 'slots' there are.
  • modify the connect() method in the Network class so that it will check if there are any free slots before a device can connect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment