Different methods for different types

  • 16
  • Locked
So, polymorphism. You haven't forgotten about it, have you? Good. Then let's complete the following task: Read data from the console until the word "exit" is entered. For each value (except "exit"), call the print method. The correct print method depends on the value. For example, if the value contains a period, then use the print method for Double. If the value is a number between 0 and 128, then use the method for short.
You can't complete this task, because you're not signed in.
  • Popular
  • New
  • Old
You must be signed in to leave a comment
This page doesn't have any comments yet