Question: Need to complete all //TO DO comments in the following class (java code): import core.HasName; /** * A MysteriousNote is a Treasure that has zero
Need to complete all //TO DO comments in the following class (java code):
import core.HasName; /** * A MysteriousNote is a Treasure that has zero value and is left by someone * with a name. */ public class MysteriousNote implements Treasure, HasName { // TODO instance variables with documentation comments /** * Constructs a MysteriousNote written by an author with the specified * name. * * @param name * The name of the author of the mysterious note. * Must not be null. */ public MysteriousNote(String name) { // TODO } @Override public long getValue() { return 0; // TODO } @Override public String getName() { return null; // TODO } @Override public String toString() { return null; // TODO } } Other related classes:
HasName.java
public interface HasName { /** * Returns the name associated with the object. * * @return the name associated with the object */ String getName(); }
Treasure.java
public interface Treasure { /** * Returns the value of the Treasure. Note that the value of a Treasure * can be positive, zero, or negative. * * @return the value of the Treasure */ long getValue(); }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
