Class TapeCassette

java.lang.Object
solution.TapeCassette

public class TapeCassette extends Object
Class representing a cassette that can store a message up to 15 characters.
  • Field Details

    • MAX_MESSAGE_LENGTH

      public static final int MAX_MESSAGE_LENGTH
      Max number of characters in a message.
      See Also:
  • Constructor Details

    • TapeCassette

      public TapeCassette()
      Creates a cassette whose message is set to the empty String.
  • Method Details

    • getMsg

      public String getMsg()
      Returns the message written on this cassette.
      Returns:
      Message on the cassette.
    • setMsg

      public void setMsg(String msg)
      Sets the message on this cassette. If the message is longer than 15, sets the first 15 characters.
      Parameters:
      msg - Message to set.