I\'m a newbie in java. I\'m writing a class where the constructor must check the price parameter and ensure it is not a negative number. And if it is negative, it must set
Your getprice() method calls itself instead of checking price. This is leading to an infinite recursion in this case.
getprice()
price