Hackerrank Day 13: Abstract Classes

Hacker Rank did not allow submissions in Ruby or Javascript for this problem so I got to experiment with Java! Syntax was pretty similar to Javascript so it wasn’t too difficult. Took me a while to solve because I didn’t know to declare price as private.

A couple things to note:

You must implement the abstract method in your subclass

To pass a new argument into the subclass (that wasn’t in the parent class), declare it as private or public first, then define it as an instance variable.