Ad
  • Default User Avatar

    What a wise choice of words. I couldn't have explained it easier than that. Nice one!

  • Custom User Avatar
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    First of all, you should not access the result variable dirctly by having it public but instead use a private variable with a get method which only returns the value of the result variable, espacially when working with inheritence.

    Secondly, I saw that you named the result variable as Result with a capitalized R instead of using all lowercase as in the other languages. I missed that while reading the description and used the C# variable name while trying to solve it in Java which of course resulted in an error. I can't see a strong argument for not having the same variable names between languages so that is something I think should be corrected.

    If you think I'm wrong on any point please let me know why, it's always fun to learn something new.

    Otherwise I think this was a great introduction to inheritance at least for Java (as that is the language I'm most familiar with and have taken a few courses in), so thanks for that.