Package flashcards

Class Flashcard

java.lang.Object
flashcards.Flashcard

public class Flashcard
extends Object
Immutable type representing a flashcard, e.g., for learning vocabulary words in a native language or foreign language.

PS1 instructions: do NOT change this class.

  • Constructor Details

    • Flashcard

      public Flashcard​(String front, String back)
      Make a flashcard.
      Parameters:
      front - the card's front side, e.g. a vocabulary word
      back - the card's back side, e.g. its definition
  • Method Details

    • getFront

      public String getFront()
      Returns:
      the card's front side
    • getBack

      public String getBack()
      Returns:
      the card's back side
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals​(Object that)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object