Question: package dsaj.design; /** Interface for objects that can be transported. */ public interface Transportable { /** Returns the weight in grams. */ public int weight();
package dsaj.design; /** Interface for objects that can be transported. */ public interface Transportable { /** Returns the weight in grams. */ public int weight(); /** Returns whether the object is hazardous. */ public boolean isHazardous(); } What must be true of any class that implements Transportable?
gives an implementation of method int weight()
gives an implementation of method boolean isHazardous()
gives an implementation of all methods described by the Sellable interface
has an instance variable keeping a weight
has an instance variable saying whether it is hazardous
has a constructor that takes arguments: an int (for the weight) and a boolean (for hazardous or not)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
