Java All in One For Dummies Fifth Edition Doug Lowe PDF Download
Java All in One For Dummies Fifth Edition Doug Lowe PDF Download
https://ebookmeta.com/product/java-all-in-one-for-dummies-fifth-
edition-doug-lowe-3/
https://ebookmeta.com/product/java-all-in-one-for-dummies-fifth-
edition-doug-lowe-2/
https://ebookmeta.com/product/java-all-in-one-for-dummies-fifth-
edition-doug-lowe/
https://ebookmeta.com/product/java-all-in-one-for-dummies-
seventh-edition-doug-lowe/
https://ebookmeta.com/product/design-and-operation-of-production-
networks-for-mass-personalization-in-the-era-of-cloud-
technology-1st-edition-dimitris-mourtzis/
Alaska Sourdough Revised Edition The Real Stuff by a
Real Alaskan Ruth Allman
https://ebookmeta.com/product/alaska-sourdough-revised-edition-
the-real-stuff-by-a-real-alaskan-ruth-allman/
https://ebookmeta.com/product/altered-earth-getting-the-
anthropocene-right-julia-adeney-thomas-editor/
https://ebookmeta.com/product/maryport-a-roman-fort-and-its-
community-1st-edition-david-j-breeze/
https://ebookmeta.com/product/bound-by-light-1st-edition-demi-
warrik/
https://ebookmeta.com/product/neolithic-stepping-stones-
excavation-and-survey-within-the-western-seaways-of-
britain-2008-2014-1st-edition-duncan-garrow-fraser-sturt/
Long Live Queer Nightlife: How the Closing of Gay Bars
Sparked a Revolution 1st Edition Amin Ghaziani
https://ebookmeta.com/product/long-live-queer-nightlife-how-the-
closing-of-gay-bars-sparked-a-revolution-1st-edition-amin-
ghaziani/
Java®
ALL-IN-ONE
5th Edition
by Doug Lowe
Contents at a Glance
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.................1
Book 6: JavaFX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . 561
Contents
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
...............1
Foolish Assumptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .2
Platform independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .8
Object orientation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .9
The Java API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .10
The Internet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .11
Type checking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .13
Exception handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .16
What’s in a Name? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .19
Compiling a program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .26
Table of Contents v
CHAPTER 3: Working with TextPad . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 35
Compiling a Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .39
Types of statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .51
White space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .52
Crafting Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .55
End-of-line comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .56
Traditional comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .56
JavaDoc comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .57
Initializing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .70
Integer types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .75
Floating-point types. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .76
Wrapper classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .79
Combining strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .83
Automatic conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .85
Type casting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .86
Shadowing Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .89
Getting input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .94
Combining Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .104
Rounding functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .119
Formatting Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .121
Floating-point weirdness . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .125
Division by zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .126
Using if Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .132
Simple if statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .132
if-else statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .134
Nested if statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .135
else-if statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .139
Comparing Strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .149
A counting loop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .152
Looping Forever . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .154
Counting backward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .168
Omitting expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .171
A guessing game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .174
An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .196
Another example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .197
Declaring parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .207
Scoping out parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .208
Understanding pass-by-value . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.209
Understanding Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .214
Witnessing an exception . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .215
Catching Exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .216
A simple example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .217
Another example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .218
Catching FileNotFoundException . . . . . . . . . . . . . . . . . . . . . . . . . .
.227
Swallowing exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .229
Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 235
Table of Contents ix
Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .242
Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .242
Drawing classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .245
Drawing arrows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .246
Declaring a Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .249
Understanding fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .253
Understanding methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.254
Understanding visibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .254
Overloading Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .257
Creating Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .259
Creating basic constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .259
Using Initializers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .265
Counting Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .270
Preventing Instances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .273
Game play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .279
A businesslike example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .280
Inheritance hierarchies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .280
Creating Subclasses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .281
Overriding Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .283
Using final . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . .287
Final methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .287
Final classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .288
Poly What? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .292
Using Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .302
Implementing an interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .304
Using an interface as a type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .305
Extending interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .306
Object as a type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .316
Overriding toString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .321
Using equals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .323
Table of Contents xi
Viewing an example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .343
Module System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . 353
An example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .357
Putting Your Classes in a JAR File . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .358
Archiving a package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .360
Understanding modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .369
Reviewing Strings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .376
Splitting a string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .384
Understanding Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .393
Creating Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .394
Initializing an Array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .395
Filling an array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .417
Copying an array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .417
Sorting an array . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .419
Searching an array. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .419
Comparing arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .420
Converting arrays to strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .420
Adding Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .428
Accessing Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .429
Printing an ArrayList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .430
Using an Iterator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .430
Updating Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .432
Deleting Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .434
Creating a LinkedList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .442
Adding Items to a LinkedList . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .443
Why Generics? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .450
Understanding Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .476
Creating a Thread . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .477
Using an Executor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .489
Synchronizing Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .491
Creating a Lock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .496
Using ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . .513
Using negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .514
Using escapes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . .516
Displaying Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .526
Picking the Right Date and Time Class for Your Application . . . . . . .
.541
Comparing Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .551
Formatting Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .554
BOOK 6: JAVAFX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . 561
Creating a Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .572
Table of Contents xv
Making a Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .576
Examining Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . .584
Handling Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .585
Switching Scenes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . .609
en Nevis.”
The Ben Nevis was the first ship owned by Pilkington & Wilson.
She was, however, too short and deep for her tonnage, her
measurements being:—
Length over all 181 feet.
Beam 38 feet 6 inches.
Depth of hold 28 feet.
Registered tonnage 1420.
At the time of her launch she was considered the finest ship ever built
at St. John’s. On her arrival in Liverpool she was at once bought by Mr.
James Beazley, having cost him when ready for sea £22,683. She loaded
for Australia in the Golden Line, and went out to Melbourne in 76 days
under Captain Christian, late of Beazley’s Constance. From Melbourne
she went to Sydney and loaded across to Shanghai; then sailing from
Shanghai in the favourable monsoon, arrived home in 104 days, 4 of
which were spent anchored off Gutztaff Island in a typhoon. The whole
voyage only occupied 9 months 27 days, and she cleared £8018 clear
profit. Her second voyage on the same route she did still better, clearing
£8920.
e “Miles Barton.”
The Miles Barton measured:—
Length 175 feet.
Beam 35 „
Depth 22 „
Registered tonnage 963 tons.
She also was bought by James Beazley and loaded in the Golden Line.
On her maiden voyage she went out to Melbourne in 82 days, and
followed up this performance with two trips of 76 days each.
e “Guiding Star.”
Arrived in Liverpool in October, 1852, and was at once
chartered by the Golden Line for £12,000, considered a huge sum in
those days. Her life, however, was not a long one, as she was lost with
all hands between January and April, 1854, and it was generally
supposed that she became embayed and back-strapped by a huge ice
island in about 44° S., 25° W.
Tragic encounters with ice were by no means unusual in the fifties
when every passage maker was trying to follow out Maury’s instructions
by running far down into southern latitudes in search of strong fair
winds.
e “Indian Queen.”
The Indian Queen, 1041 tons, the most notable Black Baller
launched in 1853, and advertised as Marco Polo’s sister ship, was a very
fast vessel, her first voyage to Australia being made in 6 months 11
days, and in 1855 she came home from Hobart in 78 days. In 1859 she
narrowly escaped the fate of Guiding Star. On 13th March, 1859, she
sailed from Melbourne for Liverpool under Captain Brewer, with 40
passengers and the usual cargo of wool and gold dust. All went well
until she was half way to the Horn, when on the 27th March the weather
became thick with a strong N.W. wind and heavy westerly swell.
On the 31st March she was in 58° S., 151° W. by account; the day
was wet, foggy and very cold and the ship logged a steady 12 knots
with the wind strong at N.W. At 2 a.m. on the following morning those
below were aroused by a violent shock, the crash of falling spars and a
grinding sound along the port side, and the first of the frightened
passengers to arrive on the poop found the ship lying broadside to
broadside with an immense iceberg. All her spars and sails above the
lower masts were hanging over the starboard side, the foremast was
broken off close to the deck and was held at an angle by its rigging, the
mainyard was in half, the bowsprit was washing about under the bows,
and though the mizen topmast was still standing the topsail yard was in
two, broken in the slings.
The night was dark and rainy and at first the watch below and
passengers thought that all was lost. They found no one at the wheel,
the port life-boat gone, and not a soul on the poop, but they were
somewhat reassured by the appearance of the carpenter who had been
sounding the pumps and pronounced the ship to be making no water.
Then the second mate appeared aft and announced that the captain,
mate and most of the crew had gone off in the port life-boat. Apparently
there had been a disgraceful panic which involved even the captain, who
actually left his own son, an apprentice, behind on the ship.
However those who had been so shamefully deserted began to buckle
to with a will, headed by the second mate, Mr. Leyvret, and the cool-
headed carpenter, a man named Thomas Howard. Passengers, cooks,
stewards and those of the crew left on board were promptly divided into
watches, the captain’s son was sent to the wheel, and whilst some set
about clearing up the raffle of gear and getting things ship-shape as far
as possible, others shovelled the ice, which lay in masses on the decks,
overboard.
With some difficulty the crossjack was backed and the head of the
spanker hauled in. At the same time the boat was perceived tossing in
the swell on the port beam and apparently endeavouring to regain the
ship, and faint cries for help could be heard against the wind. She
seemed to be without oars and with sea after sea washing over, she was
soon swept past the ship by the back wash off the ice and lost sight of
in the fog never to be seen again. The ship, though, with the backed
crossjack, began to drift along the side of the berg and presently
dropped clear of it into smoother water to leeward.
Day now began to break and all hands set about cutting away the
wreck, but the mainyard and the rest of the raffle hanging from the
stump of the mainmast was hardly clear before the terrible cry of “Ice to
leeward!” arose and a huge berg appeared looming out of the mist. The
crossjack was at once braced up, the spanker set and the foresail
trimmed in some fashion or other, then in a tense silence the survivors
watched the ship slowly forge ahead and, dragging the wreck of masts
and spars and torn sails along with her, weather the new danger by a
bare 100 yards. And scarcely had she done so when the foremast fell
crashing on to the long-boat, the other boats having been already stove
in by falling spars. The next business was to get the wreck of the
foremast over the side and clear of the ship. Here the carpenter
displayed the greatest coolness and skill, being ably backed up by the
second mate and the 4 seamen left on board. With the last of the wreck
overside, time was found to muster the survivors, when it was
discovered that the captain, chief mate and 15 men had been lost in the
port life-boat, leaving behind the second mate, carpenter, bosun, 4
A.B.’s, 1 O.S. and 2 boys, besides the cooks, stewards, doctor, purser,
and passengers who numbered 30 men, 3 women and 7 children.
A course was now steered for Valparaiso, some 3800 miles away. It
was not until the 7th April that the ship got finally clear of the scattered
ice, but on the 3rd the wind came out of the south and with a lower
stunsail and main staysail set on the main, the ship began to make 3 or
4 knots through the water.
One iceberg of huge size and square like a mountainous box was only
just cleared before it broke in two, the smaller portion bursting into the
sea like an avalanche, and sweeping a huge wave in front of it, did not
bring up until it was 2 to 3 miles away from the rest of the berg. The
last ice was seen in 54° S., it being reckoned that the accident had
happened in 60° S.
As soon as 49° S. was reached, a direct course was shaped for
Valparaiso. Sheers were now rigged and a topmast secured to the stump
of the foremast, then topsail yards were crossed on the jury foremast
and mainmast, which improved the ship’s progress another knot. In this
condition the Indian Queen slowly wandered north, weathering out gale
after gale. On the 7th May a welcome sail was sighted. This proved to
be the New Bedford whaler La Fayette, whose captain boarded them,
offered them every assistance and corrected their longitude, which was
3° out. On the following day the French man-of-war Constantine
appeared and promised to convoy them in. On the 9th May land was
made some 20 miles south of Valparaiso, and on the morning of the
10th, as the crippled Indian Queen approached the Bay, the boats of
H.M.S. Ganges, 84 guns, came out to her aid and towed her in to the
Roads, where she anchored safely, just 40 days after her collision with
the iceberg.
She was nine days making the passage of the Horn from 50° S. to 50°
S.; but shortly after rounding the Horn she carried away her fore and
main topmasts and sprang her foreyard. Captain Mackay, however, kept
the seas and refitted his ship in 14 days, during the whole of which time
he is said to have remained on deck, snatching what little sleep he
allowed himself in a deck chair. The Sovereign of the Seas in spite of this
mishap arrived in San Francisco only 103 days out, and this was
considered the best passage ever made at such an unfavourable season
of the year.
From San Francisco she went across to Honolulu in ballast and there
loaded a cargo of sperm oil; it being the custom of American whalers to
call in there and leave their oil for transhipment so as to clear their holds
for a fresh catch.
The Sovereign of the Seas left Honolulu on 13th February, 1853, for
New York, and once again made a most remarkable passage in spite of
a sprung fore topmast, jury fore topgallant mast and a weak crew—no
doubt a large number of her original crew deserted in San Francisco in
the hope of reaching the gold diggings, but more probably only to be
shanghaied on some homeward bounder.
Like all Mackay’s wonderful creations, the Sovereign of the Seas was
at her best in the roaring forties, and on the run to the Horn she made
3144 miles in 10 days, her best 24-hour runs being:—
March 11 332 miles.
„ 12 312 „
„ 16 396 „
„ 17 311 „
„ 18 411 „
„ 19 360 „
During this time she had strong quartering winds and a heavy
following sea, which drove her at times as much as 19 knots through the
water.
After rounding the Horn, she had the usual weather up through the
tropics, and arrived at New York on 6th May, 1853, having made the
record passage of 82 days from Honolulu.
As she was considered to be too big for either the San Francisco or
China trades, she was at once loaded for Liverpool, there to take part in
the booming Australian emigrant trade.
And crossing the Western Ocean she once more made an
extraordinary passage, as the following epitome shows:—
June 18 —Sailed from New York, passed Sandy Hook at 6.30 p.m.
„ 24 —Sighted Cape Race at 6 a.m.
„ 26 —Becalmed on the Banks.
„ 28 —Distance run 344 miles—ship close-hauled under single reefed topsails.
„ 30 —Distance run 340 miles, under all sail to skysails and royal stunsails off
Cape Clear at 6 a.m.
July 2—Anchored in the Mersey at 10.30 p.m.
Passage New York to Liverpool, from dock to anchorage, 13 days 22 hours 50 minutes,
and 5 days 17 hours from the Banks of Newfoundland.
Donald Mackay crossed the Atlantic on the ship and spent his whole
time watching her every movement, and it was probably the experience
gained on this passage which had much to do with the wonderful
success of his later vessels.
On her arrival in Liverpool the Sovereign of the Seas was at once
chartered by the Black Ball Line. Captain Lauchlan Mackay, however, did
not remain in her, but returned to New York, his place being taken by
Captain Warner, who had been in the ship since she was launched.
Captain Warner sailed from Liverpool on 7th September, 1853, with 25
first cabin, 40 second cabin passengers and a cargo valued at £200,000,
and wrote the following account of his passage to the Liverpool Mercury:
—
I arrived here after a long and tedious passage of 77 days, having experienced only
light and contrary winds the greater part of the passage. I have had but two chances.
The ship ran in four consecutive days 1275 miles; and the next run was 3375 miles in
12 days. These were but moderate chances. I was 31 days to the equator and carried
skysails 65 days; set them on leaving Liverpool and never shortened them for 35 days.
I crossed the equator in 26° 30′, and went to 53° 30′ S., but found no strong winds. I
think if I had gone to 58° S. I would have had wind enough: but the crew were
insufficiently clothed and about one half disabled, together with the first mate. At any
rate we have beaten all and every one of the ships that sailed with us, and also the
famous English clipper Gauntlet 10 days on the passage, although the Sovereign of the
Seas was loaded down to 23½ feet.
rrying On.
Perhaps no ships ever sailed the seas which held on to their
canvas longer than these great Black Ball and White Star clippers; and
yet the carrying away of spars and sails, which was so common an
occurrence with the earlier American clippers and also with the early
British iron clippers, was quite rare on these big emigrant ships.
There is no difficulty, however, in finding reasons for their freedom
from dismasting and heavy casualties aloft, their designers and builders
had learnt something by the dismastings and constant losses of spars
which overtook their earlier ships, and thus no ships were more
scientifically stayed than these big ships, at the same time in their outfit
we find hemp rigging and wooden spars in their highest state of
efficiency. Strength of gear had for some time been one of the chief
problems that a clipper ship builder had to contend with, and in the
rigging of these six famous ships we see this problem finally mastered.
Topsails, topgallant sails and even royals were diagonally roped from
clew to earing. The rope used for standing rigging was the very best
procurable and of immense thickness; for instance, Lightning’s lower
rigging, fore and main stays and backstays were of 11½ inch Russian
hemp; whilst in regard to spars, here are the diameters in inches of
some of James Baines’ masts and yards:—
Mainmast 42 inches in diameter.
Main topmast 21 inches in diameter.
Main topgallant mast 16 inches in diameter.
Main royal mast 14 inches in diameter.
Mainyard 26 inches in diameter.
Main topsail yard 21 inches in diameter.
Main skysail yard 8 inches in diameter.
And I have had letters scoffing at the Black Ball records, remarking
that their skippers were a leery lot and provided “palatable pabulum for
the proud passengers.”
I will now try and show that these arguments were altogether too
sweeping, and if they may possibly have applied to certain individuals,
they are by no means fair to the greater number of the skippers.
In the first place, not one of the Black Ball or White Star ships was
commanded by an American, and though the accusation was levelled at
Americans, it was evidently done in the belief that the American built
Australian clippers were commanded by Americans.
In the second place, such men as Anthony Enright, of the Lightning,
James Nicol Forbes, of the Marco Polo, Charles McDonald, of the James
Baines, Sam Reid, of the Red Jacket, Captain Pryce, R.N.R., of the
Donald Mackay, and Alexander Newlands, of the Champion of the Seas,
were known and respected all over the world as leading men in their
profession, occupying a position in the Mercantile Marine which would
correspond with that of Orient and P. & O. commanders nowadays,
whilst their performances were very much more widely known, thus
such elementary cheating as giving 60 miles to a degree in the roaring
forties would have been exposed at once.
The greatest 24-hour run ever accomplished by a sailing ship was one
of 436 nautical miles made by the Lightning when crossing the Atlantic
on her maiden passage. The second greatest run was also made by the
Lightning. This was 430 miles when running her easting down bound out
to Australia in 1857, and on the following day her run was 360. This
wonderful performance drew the following letter from Captain Enright to
his passengers, and I think it will dispose of the 60 miles to a degree
accusation, at any rate as far as the Lightning and her commander are
concerned:—
21st March, 1857.
Ladies and Gentlemen,—I cannot help informing you of the extraordinary run we have
made during the last 48 hours—or rather allowing for change of time, 46 hours and 48
minutes. During this time we have run, by thoroughly good and trustworthy
observation, no less than 790 knots or 920 statute miles, being an average of nearly 17
knots or more than 19½ statute miles per hour. Yesterday our noble ship made no less
than 430 knots amounting to an average during the 24 (23½) hours of more than 18
knots. Our change of longitude has amounted to 18 degrees, each degree being equal
to 44 miles.
I firmly believe this to be the greatest performance a sailing ship has ever
accomplished.
I hope this information will in some degree compensate you for the inconvenience
which the heavy weather has occasioned you.
And I remain, Ladies and Gentlemen,
Very faithfully yours,
A. Enright, Commander.
If further proof is wanted that Captain Enright did not allow 60 miles
to a degree, but only 44 as he states to his passengers, here are the
noon positions found by observation, not account only, from which the
runs can be verified on the chart.
March 18, Lat. 42° 34′ S., Long. 17° 04′ W.
19, Lat. 43° 0′ S., Long. 7° 17′ W.
20, Lat. 43° 0′ S., Long. 0° 55′ E.
The following is a list of all runs of 400 miles and over, which I have
been able to verify.
March 1, 1854.—Lightning 436 miles.
March 19, 1857.—Lightning 430 miles.
February 6, 1855.—James Baines 423 miles.
February 27, 1855.—Donald Mackay 421 miles.
June 18, 1856.—James Baines 420 miles.
February 27, 1854.—Red Jacket 413 miles.
January 27, 1855.—James Baines 407 miles.
July 6, 1854.—Red Jacket 400 miles.
All these performances were made running east, making the day’s
work under 24 hours.
Several other ships claimed runs of over 400 miles, but I have not
included these as I have not sufficient particulars to verify them.
Marco Polo is supposed to have done a run of 428 miles under Captain
McDonald on 7th January, 1854, and Shalimar 420 miles in 1855 on her
first passage to Australia, under Captain Robertson. With this general
account of their powers I must now return to a more detailed
description of the giant clippers themselves.
e “Lightning.”
The Lightning was built by Donald Mackay to the order of
James Baines in the winter of 1853-4 at a cost of £30,000, and on her
arrival in Liverpool was furnished and decorated below at a further cost
of £2000.
“LIGHTNING.”
From a painting.
Larger image (206 kB)
Her poop was 92 feet long and her saloon 86 feet, whilst she had 8
feet under the beams in her ’tween decks, a most unusual height for
those days.
With regard to design, she was one of the sharpest ships ever
launched. Her model is thus described by Captain H. H. Clark:—“She had
long, concave water-lines and at her load displacement line a cord from
her cut-water to just abaft the fore rigging showed a concavity of 16
inches. Her stem raked boldly forward, the lines of the bow gradually
becoming convex and blending with the sheer line and cut-water, while
the only ornament was a beautiful full-length figure of a young woman
holding a golden thunderbolt in her outstretched hand, the flowing white
drapery of her graceful form and her streaming hair completing the fair
and noble outline of the bow.
“The after-body was long and clean, though fuller than the bow, while
the stern was semi-elliptical in form, with the plank sheer moulding for
its base, and was ornamented with gilded carved work, though this
really added nothing to the beauty of the strong sweeping outline of her
hull.”
The Lightning’s spar and rigging measurements were tremendous:—
Mainmast, deck to truck 164 feet.
Foremast „ „ 151 „
Mizenmast „ „ 115 „
Mainyard „ „ 95 „
Lower stunsail booms 65 „
She spread 13,000 yards of canvas when under all plain sail. Donald
Mackay had her rigged as a three skysail yard ship, but later Messrs.
James Baines fitted her with a moonsail on the main by lengthening the
skysail mast. This was also done in the case of James Baines. And these
two ships had the proud distinction of being perhaps the only two ships
afloat which regularly crossed a moonsail yard.
The Lightning was provided with iron water tanks holding 36,000
gallons of water—a novelty at that date. And in various other ways her
accommodation for passengers was an improvement on anything
attempted before.
The great Bully Forbes was sent out to Boston to superintend her
outfit and take command of her, and he was lucky in finding a valuable
friend and adviser in Captain Lauchlan Mackay, who made the trip to
Liverpool in her as builders’ representative.
e “Red Jacket.”
The Red Jacket, Lightning’s great rival, was designed by
Samuel A. Pook, of Boston, the well-known designer of Game-cock,
Surprise, Northern Light, Ocean Telegraph, Herald of the Morning, and
other famous clipper ships. She was built by George Thomas at
Rockland, Maine, for Messrs. Seacomb & Taylor, and only took the water
a few days before the Lightning.
Her measurements were:—
Tonnage (registered) 2460 tons.
(burthen) 5000 „
Length 260 feet.
Beam 44 „
Depth 26 „
Though her bow and stern were very sharp and beautifully modelled
and she had concave bow lines, she was not so extreme a ship as the
Lightning.
“RED JACKET.”
From an old lithograph.
Larger image (195 kB)
Their 24-hour runs opened the eyes of the packet ship commanders
and in fact the whole world.
The Red Jacket put up runs of 413, 374, 371, 343, and 300 against
the Lightning’s 436, 328, 312 and 306, thus there was little to choose
between the two vessels on this point.
The Boston Daily Atlas of 18th February, 1854, thus describes the
Lightning’s departure from Boston:—
At 2 o’clock the Lightning hove her anchor up, and at 3 o’clock discharged her pilot
off Boston Light. She went down in tow of the steamer Rescue, Captain Hennessy, and
was piloted by Mr. E. G. Martin.
Before the steamer left her, she set her head sails, and fore and mizen topsails, and
had a moderate breeze from W. to S.W. She appeared to go at the rate of 6 knots
under this canvas, though she draws 22 feet of water and has only 23 feet depth of
hold.
We have seen many vessels pass through the water, but never saw one which
disturbed it less. Not a ripple curled before her cut-water, nor did the water break at a
single place along her sides. She left a wake as straight as an arrow and this was the
only mark of her progress. There was a slight swell, and as she rose we could see the
arc of her forefoot rise gently over the seas as she increased her speed. At 5 p.m., two
hours after the pilot left her, the outer telegraph station reported her 30 miles east of
Boston Light with all drawing sails set and going along like a steam boat.
And the following extract from her log book was published in the
Liverpool Albion on her arrival.
Distance.
Feb. 19 Wind, W.S.W. and N.W. moderate 200 miles.
20 „ N.N.E. and N.E. strong breezes with snow 328 „
21 „ E.S.E. with snow storms 145 „
22 „ E.S.E., a gale with high cross sea and rain 114 „
23 „ N., strong gales to E.S.E.; ends moderate 110 „
24 „ S.E., moderate 312 „
25 „ E.S.E. and S.E., fresh breezes with thick weather 285 „
26 „ W.S.W., moderate 295 „
27 „ W.N.W. „ 260 „
28 „ W. and N.W., steady breezes 306 „
March 1 „ South. Strong gales; bore away for the North Channel;
carried away the fore topsail and lost jib; hove the log
several times and found the ship going through the water
at the rate of 18 to 18½ knots; lee rail under water and
rigging slack 436 „
„
South, first part moderate, latter part light and calm.
2
„
Light winds and calms.
3
„ Light S.E. winds and calms; at 7 a.m. off Great Orme’s Head. 12 noon
8 off the N.W. lightship.
On 28th February at noon she was in Lat. 52° 38′ N., Long. 22° 45′
W., and her run of 436 nautical miles from that position to her noon
position on 1st March gives her the greatest day’s work ever
accomplished, to the best of my belief, by a sailing ship. The 1st March
entry “Wind south—bore away for the North Channel,” has misled some
nautical critics, who have plotted her as being up with Rathlin Island
when she bore away, without noticing the direction of the wind. The log
is rather ambiguously worded, but her run of 436 miles puts her some
30 miles west of Achill Head—and she then bore away north, bringing
the wind on the starboard quarter. If she had been off Rathlin Island she
would have had to bring the wind on the starboard bow for the course
through the North Channel.
Captain Charles McDonald always hoped to get a day’s run of 500
miles out of the James Baines, and firmly believed she could do it; but
he never succeeded in beating the Lightning’s records.
The Red Jacket, which was under the command of Captain Asa
Eldridge, of American packet ship fame, had strong winds from S.E. to
W.S.W. with rain, snow and hail. As with Lightning, the first half of her
passage was the slowest half and for the first seven days she could only
average 182 miles a day. But with practically the same weather, it is
interesting to compare the performances of the two vessels as they
approached the Irish Coast. Red Jacket’s last six runs were 219, 413,
374, 343, 300, and 371, giving a total of 2020 and an average of 336.
The only vessel that has ever beaten this six-day run is the famous
Cutty Sark, which in 1876, before her wings were clipped, ran 2163
miles in six days in the roaring forties, when outward bound to Sydney.
Red Jacket made the passage from Rock Light to Port Phillip Heads in
69 days 11 hours 15 minutes; passage under sail 67 days 13 hours, total
distance run 13,880 miles.
The Mermaid, which gained such an advantage over the Red Jacket in
the earlier part of the passage, ran her easting down a good deal further
to the northward, and did not arrive till the 17th July, having made a
passage of 74½ days.
Red Jacket set sail on her homeward passage on 3rd August. She was
not in very good trim this time, being too light and very much down by
the stern, however, she still continued to show her quality, constantly
logging 17 or 18 knots in fresh breezes and 14 and 15 knots when close-
hauled. Only once on the homeward passage were her topsails close-
reefed and only once did she ship any water. This was on the 31st
August in a heavy squall with foresail and fore and main topgallant sails
set.
She rounded the Horn on the 23rd August, only 20 days out, her
week’s work averaging out as follows:
1st week 231 miles per day.
2nd „ 307 „ „
3rd „ 254 „ „
But on the day after she had rounded the Horn, she had a narrow
escape of being embayed by ice, and one of her passengers gave the
following account of her danger to the newspapers:—“On the morning of
24th August, I was roused out of sleep by the noise of shortening sail
and the look-out singing out land. Ice had been seen some time before,
but the solid masses had been supposed in the dark to be land. On
getting out I found we were in smooth water and large masses of ice
floating about us. As the day broke, we found ourselves sailing along a
lake of water not unlike a canal. The ice seemed to extend on every side
in solid fields as far as the eye could reach without any prospect of
getting out, so that we had to follow the channel. All sail was clewed up
except the topsails, and as there was a good breeze we proceeded along
at about 4 or 5 knots. Our situation at this time seemed most appalling,
as we appeared to be getting further into the ice, so that by 10 or 11
o’clock we were almost making up our minds to remain for weeks in this
fearful situation.
“About noon the captain and second mate, who had been on the fore
topsail yard all the morning, discovered clear sea again, to gain which
we had to force a passage through dense masses of ice. It was here she
sustained the principal damage to her stem and copper. We soon got
clear and the rest of the day we saw no traces of ice and were very
thankful we had got off so easily. But to our dismay at 8 p.m. we again
fell in with it. The ship was put about and sail shortened for the night
and we ran back to the clear water in which we had been sailing. At
daybreak sail was made and at 7 a.m. we came up to the ice. At first it
was only large pans much melted, the water having all the appearance
of brine and being quite thick round them. Afterwards large masses of
icebergs presented themselves. In grinding the ship through these, great
difficulty was experienced—very large bergs were also interspersed and
visible all round.
“This day we cleared it again about noon. Icebergs were still,
however, seen both near and in the distance; their appearance was most
grand, the largest being thought to be about 2 miles in circumference
and 100 feet high. It was passed about 4 or 5 miles distant on our
starboard and lee side.
“We hove to again at night. Next day, Saturday, was for the most part
a dead calm and we were carried back with the current. There was not a
breath of wind; a clear sky and beautiful weather, only the air sharp.
Icebergs were, however, still seen. The next day, Sunday, we passed a
number more, which were the last ice seen. One of these was most
grand, being about 200 feet high. We cleared it on our port or windward
side about a mile or less distant. The weather during this period was
clear and fine. Indeed, the day before encountering the ice was
beautiful, a fine light breeze which heightened towards evening and sea
smooth. We were running close-hauled 14 knots an hour steadily during
the night. The sun had set a deep crimson behind a bank of clouds over
against Cape Horn.”
Red Jacket’s next three weeks’ runs averaged:—
4th week, 205 miles per day.
5th week, 237 miles per day. (Mostly light breezes, squalls and rain.)
6th week, 224 miles per day. (Easterly winds.)
The line was crossed on 13th September, the Red Jacket having run
10,243 miles in 42 days, an average of 244 per day. She now had every
hope of beating the record, but, alas, from here on she had nothing but
calms and light head winds which drove her across into 43° W. and she
was 31½ days from the line to port, reaching Liverpool on 15th October,
after a passage of 73 days. This was considered an extraordinary
performance, when allowance was made for the light weather
experienced after crossing the line. During one whole week in the
doldrums she averaged under 100 miles per day, and the two following
weeks she only averaged 142 and 106 miles respectively.
The whole voyage, however, had been a wonderfully fast one. She
had made the trip, out and home, in 5 months 10 days and 22½ hours,
and had actually circumnavigated the globe in 62 days 22 hours,
between 11th June and 2nd September, running 15,991 miles in that
time.
On her homeward passage she ran 14,863 miles, her greatest day’s
work being 376 miles and her average 202¼ miles per day.
She brought home gold dust and sovereigns to the value of £208,044.
She sailed this voyage under the American flag, being only chartered by
the White Star Line, but on her return to Liverpool Messrs. Pilkington &
Wilson bought her for the sum of £30,000.