Class Scoreboard

java.lang.Object
com.zybooks.dsaj.fundamental.Scoreboard

public class Scoreboard extends Object
Class for storing high scores in an array in nondecreasing order.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Scoreboard(int capacity)
    Constructs an empty scoreboard with the given capacity for storing entries.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Attempt to add a new score to the collection (if it is high enough)
    static void
    main(String[] args)
     
    remove(int i)
    Remove and return the high score at index i.
    Returns a string representation of the high scores list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Scoreboard

      public Scoreboard(int capacity)
      Constructs an empty scoreboard with the given capacity for storing entries.
  • Method Details