Question: Need to complete all //TO DO comments in the following class (java code): public class SimpleTreasure implements Treasure { // TODO instance variables with documentation
Need to complete all //TO DO comments in the following class (java code):
public class SimpleTreasure implements Treasure { // TODO instance variables with documentation comments /** * Constructs a new SimpleTreasure with the specified value. * * @param value * The value to assign to the SimpleTreasure. */ public SimpleTreasure(long value) { // TODO } @Override public long getValue() { return 0; // TODO } @Override public String toString() { return null; // TODO } } And this is the interface that has been implemented:
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
