Java Reference
In-Depth Information
public BankAccount (double initialBalance)
{
balance = initialBalance;
}
public BankAccount()
{
this(0);
}
. . .
}
The command this(0) ; means ȒCall another constructor of this class and supply
the value 0 ȓ. Such a constructor call can occur only as the first line in another
constructor.
This syntax is a minor convenience. We will not use it in this topic. Actually, the
use of the keyword this is a little confusing. Normally, this denotes a
reference to the implicit parameter, but if this is followed by parentheses, it
denotes a call to another constructor of this class.
R ANDOM F ACT 3.1: Electronic Voting Machines
In the 2000 presidential elections in the United States, votes were tallied by a
variety of machines. Some machines processed cardboard ballots into which voters
punched holes to indicate their choices (see Punch Card Ballot figure). When
voters were not careful, remains of paperȌthe now infamous ȒchadsȓȌwere
partially stuck in the punch cards, causing votes to be miscounted. A manual
recount was necessary, but it was not carried out everywhere due to time
constraints and procedural wrangling. The election was very close, and there
remain doubts in the minds of many people whether the election outcome would
have been different if the voting machines had accurately counted the intent of the
voters.
Subsequently, voting machine manufacturers have argued that electronic voting
machines would avoid the problems caused by punch cards or optically scanned
forms. In an electronic voting machine, voters indicate their preferences by
pressing buttons or touching icons on a computer screen. Typically, each voter is
presented with a summary screen for review before casting the ballot. The process
Search WWH ::




Custom Search