1. Show that the methods compareTo and equals are inconsistent for the class BigDecimal. That is, find two instances, b1 and b2, of BigDecimal such that b1.compareTo(b2) is zero but b1.equals(b2) is false. Hint: Consider numbers with equal values but different precisions.
2. Define a Java interface called Growable to provide certain behaviors for various plant objects. Growable plants can be watered and fed. Define a class called Rose that implements the Growable interface. Create a client to demonstrate the use of your class.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here