Java Reference
In-Depth Information
have one of these four CoinType objects, you can apply the getValue
method to obtain the coin's value.
Note that there is a major philosophical difference between this CoinType
class and the Coin class that we have discussed elsewhere in this chapter. A
Coin object represents a particular coin. You can construct as many Coin
objects as you like. Different Coin objects can be equal to another. We consider
two Coin objects equal when their names and values match. However,
CoinType describes a type of coins, not an individual coin. The four
CoinType objects are distinct from each other.
R ANDOM F ACT 10.1: Scripting Languages
Suppose you work for an office where you must help with the bookkeeping.
Suppose that every sales person sends in a weekly spreadsheet with sales figures.
One of your jobs is to copy and paste the individual figures into a master
spreadsheet and then copy and paste the totals into a word processor document
that gets e-mailed to several managers. This kind of repetitive work can be
intensely boring. Can you automate it?
It would be a real challenge to write a Java program that can help youȌyou'd
have to know how to read a spreadsheet file, how to format a word processor
document, and how to send e-mail.
Fortunately, many office software packages include scripting languages. These
are programming languages that are integrated with the software for the purpose
of automating repetitive tasks. The best-known of these scripting languages is
Visual Basic Script, which is a part of the Microsoft Office suite. The Macintosh
operating system has a language called AppleScript for the same purpose.
In addition, scripting languages are available for many other purposes.
JavaScript is used for web pages. (There is no relationship between Java and
JavaScriptȌthe name JavaScript was chosen for marketing reasons.) Tcl (short
for Ȓtool control languageȓ and pronounced Ȓtickleȓ) is an open source scripting
language that has been ported to many platforms and is often used for scripting
software test procedures. Shell scripts are used for automating software
configuration, backup procedures, and other system administration tasks.
476
477
Search WWH ::




Custom Search