Candidate

class Candidate(val name: String, val votes: Int, val party: String)

Represents a candidate in an election results application.

A candidate object is immutable.

Value parameters:
name

the candidate’s name

party

the name (or abbreviation) of the candidate’s party

votes

the number of votes received by the candidate

class Object
trait Matchable
class Any

Value members

Concrete methods

infix def >(another: Candidate): Boolean

Determines if the candidate has more votes than the other, given candidate.

Determines if the candidate has more votes than the other, given candidate.

override def toString: String

Returns a short textual description of the candidate.

Returns a short textual description of the candidate.

Definition Classes

Concrete fields

val votes: Int