0% found this document useful (0 votes)
26 views54 pages

(Ebook PDF) Java: An Introduction To Problem Solving and Programming 7Th Edition Download

The document provides links to various eBooks related to Java programming and problem-solving, including multiple editions of 'Java: An Introduction to Problem Solving and Programming'. It outlines the structure and features of the textbook, such as self-test questions, exercises, and support materials for both instructors and students. Additionally, it highlights online resources like MyProgrammingLab and VideoNotes to enhance learning and practice in programming.

Uploaded by

mornapocandu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views54 pages

(Ebook PDF) Java: An Introduction To Problem Solving and Programming 7Th Edition Download

The document provides links to various eBooks related to Java programming and problem-solving, including multiple editions of 'Java: An Introduction to Problem Solving and Programming'. It outlines the structure and features of the textbook, such as self-test questions, exercises, and support materials for both instructors and students. Additionally, it highlights online resources like MyProgrammingLab and VideoNotes to enhance learning and practice in programming.

Uploaded by

mornapocandu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

(eBook PDF) Java: An Introduction to Problem

Solving and Programming 7th Edition download

https://ebooksecure.com/product/ebook-pdf-java-an-introduction-
to-problem-solving-and-programming-7th-edition/

Download full version ebook from https://ebooksecure.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebooksecure.com
to discover even more!

(eBook PDF) Java: An Introduction to Problem Solving


and Programming 8th Edition

http://ebooksecure.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-8th-edition/

(eBook PDF) Introduction to Programming with Java: A


Problem Solving Approach 3rd Edition

http://ebooksecure.com/product/ebook-pdf-introduction-to-
programming-with-java-a-problem-solving-approach-3rd-edition/

(eBook PDF) Matlab: A Practical Introduction to


Programming and Problem Solving 4th Edition

http://ebooksecure.com/product/ebook-pdf-matlab-a-practical-
introduction-to-programming-and-problem-solving-4th-edition/

Problem Solving and Python Programming 1st edition -


eBook PDF

https://ebooksecure.com/download/problem-solving-and-python-
programming-ebook-pdf/
(eBook PDF) Programming, Problem Solving and
Abstraction with C

http://ebooksecure.com/product/ebook-pdf-programming-problem-
solving-and-abstraction-with-c/

(eBook PDF) An Introduction to Statistical Problem


Solving in Geography 3rd Edition

http://ebooksecure.com/product/ebook-pdf-an-introduction-to-
statistical-problem-solving-in-geography-3rd-edition/

Programming for Problem Solving- GTU 2018 - eBook PDF

https://ebooksecure.com/download/programming-for-problem-solving-
ebook-pdf/

Programming and Problem Solving with Python 1st Edition


- eBook PDF

https://ebooksecure.com/download/programming-and-problem-solving-
with-python-ebook-pdf/

(eBook PDF) Data Structures and Problem Solving Using


Java 4th Edition

http://ebooksecure.com/product/ebook-pdf-data-structures-and-
problem-solving-using-java-4th-edition/
Preface for Instructors vii

formulas.” This book introduces classes fairly early. Some exposure to using
classes is given in Chapters 1 and 2. Chapter 5 covers how to define classes.
All of the basic information about classes, including inheritance, is presented
by the end of Chapter 8 (even if you omit Chapter 7). However, some topics
regarding classes, including inheritance, can be postponed until later in the
course.
Although this book introduces classes early, it does not neglect traditional
programming techniques, such as top-down design and loop design tech-
niques. These older topics may no longer be glamorous, but they are informa-
tion that all beginning students need.

Generic Programming
Students are introduced to type parameters when they cover lists in Chapter
12. The class ArrayList is presented as an example of how to use a class that
has a type parameter. Students are then shown how to define their own classes
that include a type parameter.

Language Details and Sample Code


This book teaches programming technique, rather than simply the Java
language. However, neither students nor instructors would be satisfied
with an introductory programming course that did not also teach the
programming language. Until you calm students’ fears about language
details, it is often impossible to focus their attention on bigger issues.
For this reason, the book gives complete explanations of Java language
features and lots of sample code. Programs are presented in their entirety,
along with sample input and output. In many cases, in addition to the
complete examples in the text, extra complete examples are available over
the Internet.

Self-Test Questions
Self-test questions are spread throughout each chapter. These questions have a
wide range of difficulty levels. Some require only a one-word answer, whereas
others require the reader to write an entire, nontrivial program. Complete an-
swers for all the self-test questions, including those requiring full programs, are
given at the end of each chapter.

Exercises and Programming Projects


Completely new exercises appear at the end of each chapter. Since only you,
and not your students, will have access to their answers, these exercises are
suitable for homework. Some could be expanded into programming projects.
However, each chapter also contains other programming projects, several of
which are new to this edition.
viii Preface for Instructors

Support Material
The following support materials are available on the Internet at www
.pearsonhighered.com/irc:

For instructors only:


■ Solutions to most exercises and programming projects
■ PowerPoint slides
■ Lab Manual with associated code.
Instructors should click on the registration link and follow instructions to re-
ceive a password. If you encounter any problems, please contact your local
Pearson Sales Representative. For the name and number of your sales represen-
tative, go to pearsonhighered.com/replocator.

For students:
■ Source code for programs in the book and for extra examples

■ Student lab manual

■ VideoNotes: video solutions to programming examples and exercises.

Visit www.pearsonhighered.com/savitch to access the student resources.

Online Practice and Assessment with MyProgrammingLab


MyProgrammingLab helps students fully grasp the logic, semantics, and syn-
tax of programming. Through practice exercises and immediate, personalized
feedback, MyProgrammingLab improves the programming competence of be-
ginning students who often struggle with the basic concepts and paradigms of
popular high-level programming languages.
A self-study and homework tool, a MyProgrammingLab course consists
of hundreds of small practice problems organized around the structure of this
textbook. For students, the system automatically detects errors in the logic and
syntax of their code submissions and offers targeted hints that enable students
to figure out what went wrong—and why. For instructors, a comprehensive
gradebook tracks correct and incorrect answers and stores the code inputted by
students for review.
MyProgrammingLab is offered to users of this book in partnership with
Turing’s Craft, the makers of the CodeLab interactive programming exer-
cise system. For a full demonstration, to see feedback from instructors and
students, or to get started using MyProgrammingLab in your course, visit
www.myprogramminglab.com.

VideoNotes
VideoNote VideoNotes are designed for teaching students key programming concepts
and techniques. These short step-by-step videos ­demonstrate how to solve
Preface for Instructors ix

problems from design through coding. VideoNotes ­allow for self-placed in-
struction with easy navigation including the ability to select, play, rewind, fast-
forward, and stop within each VideoNote exercise.
Margin icons in your textbook let you know when a VideoNote video is
available for a particular concept or homework problem.

Integrated Development Environment Resource Kits


Professors who adopt this text can order it for students with a kit containing
seven popular Java IDEs (the most recent JDK from Oracle, Eclipse, NetBeans,
jGRASP, DrJava, BlueJ, and TextPad). The kit also includes access to a Web
site containing written and video tutorials for getting started in each IDE. For
ordering information, please contact your campus Pearson Education repre-
sentative or visit www.pearsonhighered.com.

Contact Us
Your comments, suggestions, questions, and corrections are always welcome.
Please e-mail them to [email protected].
Preface for Students

This book is designed to teach you the Java programming language and, even
more importantly, to teach you basic programming techniques. It requires
no previous programming experience and no mathematics other than some
simple high school algebra. However, to get the full benefit of the book, you
should have Java available on your computer, so that you can practice with the
examples and techniques given. The latest version of Java is preferable, but a
version as early as 5 will do.

If You Have Programmed Before


You need no previous programming experience to use this book. It was
designed for beginners. If you happen to have had experience with some
other programming language, do not assume that Java is the same as the
programming language(s) you are accustomed to using. All languages are
different, and the differences, even if small, are large enough to give you
problems. Browse the first four chapters, reading at least the Recap portions.
By the time you reach Chapter 5, it would be best to read the entire chapter.
If you have programmed before in either C or C++, the transition to Java
can be both comfortable and troublesome. At first glance, Java may seem
almost the same as C or C++. However, Java is very different from these lan-
guages, and you need to be aware of the differences. Appendix 6 compares Java
and C++ to help you see what the differences are.

Obtaining a Copy of Java


Appendix 1 provides links to sites for downloading Java compilers and pro-
gramming environments. For beginners, we recommend Oracle’s Java JDK for
your Java compiler and related software and TextPad as a simple editor envi-
ronment for writing Java code. When downloading the Java JDK, be sure to
obtain the latest version available.

Support Materials for Students


■ Source code for programs in the book and for extra examples
■ Student lab manual
■ VideoNotes: video solutions to programming examples and exercises.
Visit www.pearsonhighered.com/savitch to access the student resources.

x
Preface for Students xi

Learning Aids
Each chapter contains several features to help you learn the material:
■ The opening overview includes a brief table of contents, chapter objectives
and prerequisites, and a paragraph or two about what you will study.
■ Recaps concisely summarize major aspects of Java syntax and other impor-
tant concepts.
■ FAQs, or “frequently asked questions,” answer questions that other students
have asked.
■ Remembers highlight important ideas you should keep in mind.
■ Programming Tips suggest ways to improve your programming skills.
■ Gotchas identify potential mistakes you could make—and should avoid—
while programming.
■ Asides provide short commentaries on relevant issues.
■ Self-Test Questions test your knowledge throughout, with answers given
at the end of each chapter. One of the best ways to practice what you are
learning is to do the self-test questions before you look at the answers.
■ A summary of important concepts appears at the end of each chapter.

Online Practice with MyProgrammingLab


A self-study and practice tool, a MyProgrammingLab course consists of
hundreds of small practice problems organized around the structure of this
textbook. The system automatically detects errors in the logic and syntax of
your code submissions and offers targeted hints that enable you to figure
out what went wrong—and why. Visit www.myprogramminglab.com for
more information.

VideoNotes
These short step-by-step videos demonstrate how to solve problems from design VideoNote
through coding. VideoNotes allow for self-placed instruction with easy navigation
including the ability to select, play, rewind, fast-forward, and stop within each
VideoNote exercise. Margin icons in your textbook let you know when a VideoNote
video is available for a particular concept or homework problem.

This Text Is Also a Reference Book


In addition to using this book as a textbook, you can and should use it as a
reference. When you need to check a point that you have forgotten or that you
hear mentioned by somebody but have not yet learned yourself, just look in
the index. Many index entries give a page number for a “recap.” Turn to that
page. It will contain a short, highlighted entry giving all the essential points
xii Preface for Students

on that topic. You can do this to check details of the Java language as well as
details on programming techniques.
Recap sections in every chapter give you a quick summary of the main
points in that chapter. Also, a summary of important concepts appears at the
end of each chapter. You can use these features to review the chapter or to
check details of the Java language.
To improving results

get with the programming


Through the power of practice and immediate personalized
feedback, MyProgrammingLab improves your performance.

Learn more at www.myprogramminglab.com


This page intentionally left blank
Acknowledgments
We thank the many people who have made this seventh edition possible, in-
cluding everyone who has contributed to the first six editions. We begin by
recognizing and thanking the people involved in the development of this new
edition. The comments and suggestions of the following reviewers were in-
valuable and are greatly appreciated. In alphabetical order, they are:
Christopher Crick—Oklahoma State University
Christopher Plaue—University of Georgia
Frank Moore—University of Alaska Anchorage
Greg Gagne—Westminster College
Helen Hu—Westminster College
Paul Bladek—Edmonds Community College, Washington
Paul LaFollette—Temple University
Pei Wang—Temple University
Richard Cassoni—Palomar College
Walter Pistone—Palomar College
Many other reviewers took the time to read drafts of earlier editions of the book.
Their advice continues to benefit this new edition. Thank you once again to:
Adel Elmaghraby—University of Louisville
Alan Saleski—Loyola University Chicago
Anthony Larrain—DePaul University
Arijit Sengupta—Raj Soin College of Business, Wright State University
Asa Ben-Hur—Colorado State University
Ashraful A. Chowdhury—Georgia Perimeter College
Billie Goldstein—Temple University
Blayne Mayfield—Oklahoma State University
Boyd Trolinger—Butte College
Charles Hoot—Oklahoma City University
Chris Hoffmann—University of Massachusetts, Amherst
Dan Adrian German—Indiana University
Dennis Brylow—Marquette University
Dolly Samson—Hawaii Pacific University
Donald E. Smith—Rutgers University
Drew McDermott—Yale University
Ed Gellenbeck—Central Washington University
Faye Tadayon-Navabi—Arizona State University
Gerald Baumgartner—Louisiana State University
Gerald H. Meyer—LaGuardia Community College
Gobi Gopinath—Suffolk County Community College
Gopal Gupta—University of Texas, Dallas
H. E. Dunsmore—Purdue University, Lafayette
Helen H. Hu—Westminster College
Howard Straubing—Boston College
James Roberts—Carnegie Mellon University xv
xvi Acknowledgments

Jim Buffenbarger—Boise State University


Joan Boone—University of North Carolina at Chapel Hill
John Motil—California State University, Northridge
Ken Slonneger—University of Iowa
Laird Dornan—Sun Microsystems, Inc.
Le Gruenwald—University of Oklahoma
Lily Hou—Carnegie Mellon University
Liuba Shrira—Brandeis University
Martin Chetlen—Moorpark College
Mary Elaine Califf—Illinois State University
Michele Kleckner—Elon University
Michael Clancy—University of California, Berkeley
Michael Litman—Western Illinois University
Michael Long—California State University
Michael Olan—Richard Stockton College of New Jersey
Michal Young—University of Oregon
Nan C. Schaller—Rochester Institute of Technology
Peter Spoerri—Fairfield University
Ping-Chu Chu—Fayetteville State University
Prasun Dewan—University of North Carolina, Chapel Hill
Ricci Heishman—North Virginia Community College
Richard Whitehouse—Arizona State University
Richard A. Johnson—Missouri State University
Richard Ord—University of California, San Diego
Robert Herrmann—Sun Microsystems, Inc., Java Soft
Robert Holloway—University of Wisconsin, Madison
Rob Kelly—State University of New York at Stony Brook
Robert P. Burton—Brigham Young University
Ryan Shoemaker—Sun Microsystems, Inc.
Stan Kwasny—Washington University
Stephen F. Weiss—University of North Carolina, Chapel Hill
Steven Cater—Kettering University
Subramanian Vijayarangam—University of Massachusetts, Lowell
Tammy VanDeGrift—University of Portland
Thomas Cortina—Carnegie Mellon University
Thomas VanDrunen—Wheaton College
Y. Annie Liu—State University of New York at Stony Brook
We thank Frank Carrano for his revision of the fifth edition of this text-
book. Last but not least, we thank the many students in classes at the Univer-
sity of California, San Diego (UCSD), who were kind enough to help correct
preliminary versions of this text, as well as the instructors who class-tested
these drafts. In particular, we extend a special thanks to Carole McNamee of
California State University, Sacramento, and to Paul Kube of UCSD. These stu-
dent comments and the detailed feedback and class testing of earlier editions
of the book were a tremendous help in shaping the final book.
W. S.
K. M.
Dependency Chart

This chart shows the prerequisites for the chapters in the book. If there is a line between two boxes,
the material in the higher box should be covered before the material in the lower box. Minor varia-
tions to this chart are discussed in the “Prerequisites” section at the start of each chapter. These
variations usually provide more, rather than less, flexibility than what is shown on the chart.
Chapter 1
Introduction

Chapter 2
Primitive Types, Strings

Chapter 3
Flow of Control: Branching

Chapter 4
Flow of Control: Loops

Chapter 5 and 6
Section 7.1
Classes and Methods
Array Basics

Section 9.1 Section 10.1


Chapter 7*
Exception Basics Overview of Files
Arrays

Section 10.2
Chapter 11** Chapter 8** Text Files
Recursion Inheritance

Section 10.3
Chapter 13** Chapter 9* Any Files
Basic Swing Exceptions

Section 10.4
Chapter 14 Chapter 15 Binary Files
Applets More Swing

Section 10.5
* Note that some sections of these File I/O for Objects
chapters can be covered sooner.
Those sections are given in this chart.
** These chapters contain sections
that can be covered sooner. See the Chapter 12** Section 10.6
chapter’s “Prerequisites” section for Data Structures, Generics Files and Graphics
full details.
Features of This Text
Recaps
Recap Bytes and Memory Locations
Summarize Java syntax and other
important concepts. A computer’s main memory is divided into numbered units called
bytes. The number of a byte is called its address. Each byte can hold
eight binary digits, or bits, each of which is either 0 or 1. To store a
Remembers piece of data that is too largeRemember 
to fit into a single byte, theVariables
Syntactic computer
uses several adjacent bytes. These adjacent bytes are thought of as a
Highlight important ideas that single, larger memory location whose
When youaddress is the address
see something in thisofbook
the first
like Type, Variable_1, or
students should keep in mind. of the adjacent bytes. Variable_2 used to describe Java syntax, these words do not literally
appear in your Java code. They are syntactic variables, which are a
kind of blank that you fill in with something from the category that
they describe. For example, Type can be replaced by int, double,
char, or any other type name. Variable_1 and Variable_2 can each be
replaced by any variable name.

Programming Tips ■ Programming Tip   Initialize Variables


Give students helpful advice about A variable that has been declared, but that has not yet been given a value by an
assignment statement (or in some other way), is said to be uninitialized. If the
programming in Java. variable is a variable of a class type, it literally has no value. If the variable has a
primitive type, it likely has some default value. However, your program will be
clearer if you explicitly give the variable a value, even if you are simply reassigning the
default value. (The exact details on default values have been known to change and
should not be counted on.)
One easy way to ensure that you do not have an uninitialized variable
is to initialize it within the declaration. Simply combine the declaration and an
assignment statement, as in the following examples:
int count = 0;
double taxRate = 0.075;
char grade = 'A';
int balance = 1000, newBalance;
Note that you can initialize some variables and not initialize others in a declaration.
Sometimes the compiler may complain that you have failed to initialize a
variable. In most cases, that will indeed be true. Occasionally, though, the compiler
is mistaken in giving this advice. However, the compiler will not compile your
program until you convince it that the variable in question is initialized. To make the
compiler happy, initialize the variable when you declare it, even if the variable will
be given another value before it is used for anything. In such cases, you cannot argue
with the compiler. ■

Gotchas Gotcha   Hidden Errors

Identify potential mistakes in Just because your program compiles and runs without any errors and even
produces reasonable-looking output does not mean that your program is
programming that students might correct. You should always run your program with some test data that gives
make and should avoid. predictable output. To do this, choose some data for which you can compute
the correct results, either by using pencil and paper, by looking up the answer, or
by some other means. Even this testing does not guarantee that your program is
correct, but the more testing you do, the more confidence you can have in your
program. ■

FAQs FAQ11 FAQ stands for “frequently asked question.” Why just 0s and 1s?

Provide students answers to frequently Computers use 0s and 1s because it is easy to make an electrical device
asked questions within the context of that has only two stable states. However, when you are programming,
you normally need not be concerned about the encoding of data as 0s
the chapter. and 1s. You can program as if the computer directly stored numbers,
letters, or strings of characters in memory.
   There is nothing special about calling the states zero and one. We
could just as well use any two names, such as A and B or true and false.
The important thing is that the underlying physical device has two stable
states, such as on and off or high voltage and low voltage. Calling these
two states zero and one is simply a convention, but it’s one that is almost
universally followed.

xviii
Features of This Text xix

Listings LISTING 1.2   Drawing a Happy Face

Show students complete programs import javax.swing.JApplet;

with sample output. import java.awt.Graphics;


public class HappyFace extends JApplet
{
public void paint(Graphics canvas)
{
canvas.drawOval(100, 50, 200, 200);
canvas.fillOval(155, 100, 10, 20);
canvas.fillOval(230, 100, 10, 20);
canvas.drawArc(150, 160, 100, 50, 180, 180);
}
}
Applet Output

Case Studies Case Study Unit Testing


So far we’ve tested our programs by running them, typing in some input, and
Take students from problem statement visually checking the results to see if the output is what we expected. This is fine
to algorithm development to Java code. for small programs but is generally insufficient for large programs. In a large
program there are usually so many combinations of interacting inputs that it
would take too much time to manually verify the correct result for all inputs.
Additionally, it is possible that code changes result in unintended side effects.
For example, a fix for one error might introduce a different error. One way to
attack this problem is to write unit tests. Unit testing is a methodology in which
the programmer tests the correctness of individual units of code. A unit is often a
method but it could be a class or other group of code.
The collection of unit tests becomes the test suite. Each test is generally
automated so that human input is not required. Automation is important
because it is desirable to have tests that run often and quickly. This makes it
possible to run the tests repeatedly, perhaps once a day or every time code is
changed, to make sure that everything is still working. The process of running
tests repeatedly is called regression testing.
Let’s start with a simple test case for the Species class in Listing 5.19. Our
first test might be to verify that the name, initial population, and growth rate
is correctly set in the setSpecies method. We can accomplish this by creating

VideoNotes
Step-by-step video solutions to
programming examples and homework
exercises. VideoNote
Writing arithmetic
expressions and statements
xx Features of This Text

Programming Examples
Provide more examples of Java  Programming Example Nested Loops
programs that solve specific problems.
The body of a loop can contain any sort of statements. In particular, you
can have a loop statement within the body of a larger loop statement. For
5.1theClass
example, programand Method
in Listing Definitions
4.4 uses 291
a while loop to compute the
average of a list of nonnegative scores. The program asks the user to enter
all the scores followed by a negative sentinel value to mark the end of the
parameter of a primitive type—such as int, double , or
data. This while—is
char loop isaplaced
localinside a do-while loop so that the user
can repeat the entire process for another exam, and another, until the user
variable. wishes to end the program.

When a method is invoked, each parameter is initialized to the value of the


corresponding argument in the method invocation. This type of substitution
is known as the call-by-value parameter mechanism. The argument in a
Self-Test Questions
method invocation can be a literal constant, such as 2 or S e lf- T est Q u esti o n s
Provide students
'A'; a variable; with thethat
or any expression opportunity
yields a value of28.the appropriate
Given the class Species as defined in Listing 5.19, why does the
to practice skills learned in the chapter. following program cause an error message?
type.
Answers at the end of each chapter public class SpeciesEqualsDemo
Note that
giveifimmediate
you use a variable
feedback.of a primitive type as an argument
{
in a
public static void main(String[] args)
method invocation, the method invocation cannot change { the value of
Species s1, s2; s1.
this argument variable. setSpecies(“Klingon ox”, 10, 15);
s2.setSpecies(“Klingon ox”, 10, 15);
if (s1 == s2)
System.out.println(“Match with ==.”);
else
methods as well: void methods can have formal parameters, which }
are handled inSystem.out.println(“Do Notmatchwith ==.”)

exactly the same way as we just described for methods that return
} a value.
It is possible, even common, to have more than29. one formal
After correcting parameter
the program in the previousSeveral
question, what output does
the program produce?
in a method definition. In that case, each formal parameter is listed in the parameters are
method heading, and each parameter is preceded by a data type. For example, possible
30. What is the biggest difference between a parameter in a
of a primitive type
and a parameter of a class type?
method
the following might be the heading of a method definition:
31. Given the class Species, as defined in Listing 5.19, and the class

public void doStuff(int n1, int n2, double cost, char code)

Even if more than one parameter has the same


Asides
type, each parameter must be preceded by a type Aside Use of the Terms Parameter and
Give short commentary on relevant Argument
name.
topics.
The number of arguments given in a method Our use of the terms parameter and argument
invocation must be exactly the same as the is consistent with common usage. We use
number of formal parameters in the heading of parameter to describe the definition of the
the method definition. For example, the following data type and variable inside the header of
a method and argument to describe items
might be an invocation of our hypothetical method
passed into a method when it is invoked.
doStuff:
However, people often use these terms
anObject.doStuff(42, 100, 9.99, Z); interchangeably. Some people use the term
parameter both for what we call a formal
As suggested by this example, the correspondence parameter and for what we call an argument.
is one of order and type. The first argument in the Other people use the term argument both
method call is plugged in for the first parameter for what we call a formal parameter and for
in the method definition heading, the second what we call an argument. When you see the
argument in the method call is plugged in for the term parameter or argument in other books,
second parameter in the heading of the method you must figure out its exact meaning from
the context.
definition, and so forth. Each argument must
match its corresponding parameter in data type,
except for the automatic type conversions that we discussed earlier.
One word of warning: Parameters of a class type behave differently from Arguments must
parameters of a primitive type. We will discuss parameters of a class type later match parameters
in this chapter. in number, order,
and type
Brief Contents

Chapter 1 Introduction to Computers and Java 1

Chapter 2 Basic Computation 47

Chapter 3 Flow of Control: Branching 139

Chapter 4 Flow of Control: Loops 199

Chapter 5 Defining Classes and Methods 267

Chapter 6 More About Objects and Methods 383

Chapter 7 Arrays 491

Chapter 8 Inheritance, Polymorphism, and


Interfaces 589

Chapter 9 Exception Handling 671

Chapter 10 Streams, File I/O, and Networking 739

Chapter 11 Recursion 821

Chapter 12 Dynamic Data Structures and Generics 869

Appendices
1 Getting Java 941
2 Running Applets 942

xxi
xxii Brief Contents

3 Protected and Package Modifiers 944


4 The DecimalFormat Class 945
5 javadoc 949
6 Differences Between C++ and Java 952
7 Unicode Character Codes 956
8 Introduction to Java 8 Functional
Programming 957

Index 962

The following chapters and appendices, along with an index to their contents,
are on the book’s Web site:

Chapter 13 Window Interfaces Using Swing

Chapter 14 Applets and HTML

Chapter 15 More Swing

Appendices
9 The Iterator Interface
10 Cloning
11 Java Reserved Keywords
Contents

Chapter 1 Introduction to Computers and Java 1

1.1 Computer Basics  2


Hardware and Memory 3
Programs 6
Programming Languages, Compilers, and Interpreters 7
Java Bytecode 9
Class Loader 11

1.2 A Sip of Java  12


History of the Java Language 12
Applications and Applets 13
A First Java Application Program 14
Writing, Compiling, and Running a Java Program 19

1.3 Programming Basics  21


Object-Oriented Programming 21
Algorithms 25
Testing and Debugging 27
Software Reuse 28

1.4 Graphics Supplement  30


A Sample Graphics Applet 30
Size and Position of Figures 32
Drawing Ovals and Circles 34
Drawing Arcs 35
Running an Applet 37

Chapter 2 Basic Computation 47

2.1 Variables and Expressions  48


Variables 49
Data Types 51

xxiii
xxiv Contents

Java Identifiers 53
Assignment Statements 55
Simple Input 58
Simple Screen Output 60
Constants 60
Named Constants 62
Assignment Compatibilities 63
Type Casting 65
Arithmetic Operators 68
Parentheses and Precedence Rules 71
Specialized Assignment Operators 72
Case Study: Vending Machine Change 74
Increment and Decrement Operators 79
More About the Increment and Decrement Operators 80

2.2 The Class String 81


String Constants and Variables 81
Concatenation of Strings 82
String Methods 83
String Processing 85
Escape Characters 88
The Unicode Character Set 89

2.3 Keyboard and Screen I/O 91


Screen Output 91
Keyboard Input 94
Other Input Delimiters (Optional) 99
Formatted Output with printf (Optional) 101

2.4 Documentation and Style  103


Meaningful Variable Names 103
Comments 104
Indentation 107
Using Named Constants 107

2.5 Graphics Supplement  109


Style Rules Applied to a Graphics Applet 110
Creating a Java GUI Application with the JFrame Class 110
Introducing the Class JOptionPane 113
Reading Input as Other Numeric Types 123
Another Random Scribd Document
with Unrelated Content
BISHOP BURNET ANNOUNCING HER ACCESSION TO ANNE. (See p. 535.)
[See larger version]
On the 23rd of April the coronation took place, being St. George's
Day. The queen was so corpulent and so afflicted with gout that she
could not stand more than a few minutes at a time, and was obliged
to be removed from one situation to another during this fatiguing
ceremony in an open chair. Tenison, the Archbishop of Canterbury,
officiated, and the whole ceremony and banquet did not end till
eight in the evening. Everybody, say the newspapers, was satisfied,
even the thieves, who managed to carry off the whole of the plate
used at the banquet in Westminster Hall, together with a rich booty
of table-linen and pewter.
During March and April there was a continual arrival of
ambassadors-extraordinary to congratulate her Majesty on her
accession. Prussia, Denmark, Sweden, most of the German States,
and particularly those of Zell and Hanover, sent their envoys; and
there was a strong discussion in the Council on the necessity of
declaring war against France. Marlborough and his faction were, of
course, for war, in which he hoped to win both glory and affluence;
but Rochester and the majority of the Council, including the Dukes
of Somerset and Devon, and the Earl of Pembroke, strongly opposed
it, on the ground that the quarrel really concerned the Continental
States and not us, and that it was sufficient on our part to act as
auxiliaries, and not as the principal. The queen, however, being
determined by the Marlborough influence to declare war, laid her
intentions before Parliament, which supported her, and accordingly
war was proclaimed on the 4th of May, the Emperor and the States-
General issuing their proclamations at the same time. Louis was
charged with having seized on the greater part of the Spanish
dominions, with the design of destroying the liberties of Europe, and
with grossly insulting the queen by declaring the pretended Prince of
Wales the real king of Great Britain and Ireland. When these charges
were read over by De Torcy to Louis, he broke out into keen
reproaches against the Queen of England, and vowed that he would
"make Messieurs the Dutch repent of their presumption." He delayed
his counter-declaration till the 3rd of July. The Commons presented
an address to her Majesty, praying her Majesty to unite with the
Emperor and the States to prohibit all intercourse with France and
Spain, and at the same time to promote commerce in other
directions; and the Lords addressed her, praying her to sanction the
fitting out of privateers to make reprisals on the enemies' ships,
which interrupted our trade, and also to grant charters to all persons
who should seize on any of the French and Spanish territories in the
Indies. The queen thanked them for their zeal, and prorogued
Parliament on the 25th of May.
We may now turn our attention to the progress of the war. When the
States-General received the news of the death of William, they were
struck with the utmost consternation. They appeared to be
absolutely paralysed with terror and dismay. There was much
weeping, and amid vows and embraces they passed a resolution to
defend their country with their lives. The arrival of the address of the
Queen of England to her Privy Council roused their spirits, and this
was followed by a letter from the Earl of Marlborough, addressed to
the Pensionary Fagel, assuring the States of the queen's
determination to continue the alliance and assistance against the
common enemy. The queen herself addressed to the States a letter
confirming these assurances, and despatched it by Mr. Stanhope,
who was again appointed Ambassador at the Hague. Marlborough
himself, who left England on the 12th of May to assume his foreign
command, arriving directly afterwards in the character not only of
Commander-in-Chief of the British forces, with a salary of ten
thousand pounds a year, but of Ambassador Extraordinary and
Plenipotentiary, assured the States that the Queen of England was
resolved to maintain all the alliances, and resist the encroachments
of the French in the same spirit as the late king.
War had been going on some time on the Rhine before Marlborough
arrived there, and still longer before he was prepared to join in it. In
Germany many negotiations had been going on to induce the petty
States to act as contingents of the Empire, or to keep them from
joining the French against their own nation. The House of Brunswick
had engaged to bring to the allied army ten thousand men; Prussia
had engaged to co-operate, and Saxe-Gotha and Wolfenbüttel to
abandon the French. The Electors of Bavaria and Cologne, who had,
most traitorously to the Empire, aided France in her attempts to
enslave Germany, pretended now to stand neutral, but the neutrality
was hollow; and the position of affairs in Poland effectually
prevented the northern Powers of Germany from sending assistance
to the Allies in Flanders. Charles XII., still pursuing the Elector of
Saxony as King of Poland, threatened to invade Saxony. He marched
first to Warsaw, and ordered the Cardinal-Primate to summon a Diet
to choose another king, and Augustus, the Saxon King, posted
himself at Cracow. This state of affairs overawed Prussia, and
beyond the Alps the condition of Savoy and Milan, where the French
were strong, tended to prevent a full concentration of force in the
Netherlands against France.
The position of the contending forces on the Rhine and in the
Netherlands was this:—The Prince of Saarbrück, at the head of
twenty-five thousand men, Dutch, Prussians, and Badenese, was
besieging Kaiserwerth. Athlone and Cohorn were covering the siege
of Kaiserwerth, Athlone (Ginkell) lying between the Rhine and the
Meuse, Cohorn with ten thousand at the mouth of the Scheldt. On
the other hand, Tallard, with thirteen thousand men on the opposite
side of the Rhine, annoyed the besiegers of Kaiserwerth with his
artillery, and managed to throw into the town fresh troops,
ammunition, and supplies. Count Delamotte and the Spanish Marquis
of Bedmar covered the western frontier of the Spanish Netherlands,
and the Prince of Baden was posted on the Upper Rhine.
Whilst in this position Cohorn marched into the Netherlands,
destroyed the French lines between the forts of Donat and Isabella,
and levied contributions on the chatellany of Bruges; but Bedmar
and Delamotte advancing, he cut the dykes, inundated the country,
and retired under the walls of Sluys. Meanwhile the Duke of
Burgundy, taking the command of the army of Boufflers at Zanten,
near Cleves, formed a design to surprise Nimeguen in conjunction
with Tallard, who suddenly quitted his post near Kaiserwerth, and
joined Burgundy. Nimeguen was without a garrison, and ill supplied
with artillery, and must have fallen an easy prey, had not Athlone,
perceiving the object of the enemy, by a masterly march got the
start of them, and posted himself under the walls of the town before
the arrival of the French guards.
Marlborough all this time was undergoing his first experience of the
difficulties of acting at the head of a miscellaneous body of allies,
and with the caution of Dutch burgomasters. He had blamed William
severely for his slow movements, and now he was himself hampered
by the same obstructions. It was the end of June before he could
bring into order the necessary arrangements for taking the field. Nor
could he have effected this so soon had not the near surprise of
Nimeguen alarmed the Dutch for their frontiers, and quickened their
movements. The fall of Kaiserwerth was another circumstance in his
favour. He collected the forces which had been engaged there,
marched the English troops up from Breda, and in the beginning of
July found himself at Nimeguen at the head of sixty thousand men.
Even then he did not find himself clear of difficulties. His bold plans
were checked by the presence of two field deputies which the Dutch
always sent along with their generals, and who would not permit
him to undertake any movement until they had informed the States-
General of it and received their sanction. Thus it was not the general
in the field, but the States-General at a distance, who really directed
the evolutions of the war; and the only wonder is, that a general in
such absurd leading-strings could effect anything at all. Besides this
standing nuisance, Marlborough found Athlone, the Prince of
Saarbrück, and the other chief generals, all contending for equal
authority with him, and refusing to submit to his commands; and
when the States-General freed him, by a positive order, from this
difficulty, the Hanoverians refused to march without an order from
Bothmar, their Ambassador at the Hague. Instead of sending to
Bothmar, Marlborough summoned him to the camp, as the proper
place for him if he was to direct the movements of the Hanoverian
troops, and got rid of this obstacle only to find the Prussians raising
the same difficulties.
It was not till the 7th of July that he crossed the Waal and
encamped at Druckenburg, a little south of Nimeguen. It was the
16th when he crossed the Meuse and posted himself at Overhasselt,
with the French forces in front at the distance of two leagues and a
half, entrenched between Goch and Gedap. Here, in a letter to
Godolphin, he complained that still the fears of the Dutch hampered
his movements. He then recrossed the river at Grave, and reached
Gravenbroek, where he was joined by the British train of artillery
from Holland. Thus prepared, he advanced on the French; on the
2nd of August was at Petit Brugel in their front; but they retired
before him, leaving Spanish Guelderland in his power. He determined
to bring the French to an engagement, but was restrained by the
fears of the Dutch deputies; but, fortunately for him, the French
generals had their fears too, and the Duke of Burgundy, finding
Marlborough pressing on him in spite of his obstructions, resigned
his command rather than risk a defeat, and returned to Versailles,
leaving the command to Boufflers. The deputies of the States,
encouraged by these symptoms, recommended Marlborough to clear
the French from Spanish Guelderland, where the places which they
still held on the Meuse interrupted the commerce of that river.
Though the Dutch were merely looking at their own interests in this
design, Marlborough was glad to attack the enemy anywhere. He
despatched General Schultz to reduce the town and castle of Werk,
and in the beginning of September laid siege to Venloo, which, on
the 28th of the month, surrendered. Fort St. Michael, at Venloo, was
stormed by the impetuous Lord Cutts, unrivalled at that work, at the
head of the English volunteers, amongst whom the young Earl of
Huntingdon greatly distinguished himself. He next invested and
reduced Ruremond and the fort of Stevensweert; and Boufflers,
confounded by the rapid successes of Marlborough, retiring on
Liége, the English general followed him, reduced the place, stormed
the citadel, and seized in it three hundred thousand florins in gold,
and a million florins in bills on the substantial merchants of the city,
who promptly paid the money. This terminated the campaign.
Marlborough had wonderfully raised his reputation, won the entire
confidence of the States, and, having seen the French retire behind
their lines, he distributed his troops into winter quarters, and
projected his journey homewards.
The operations at sea had not been so decisive as those of
Marlborough on land. On the 12th of May Sir John Munden, sent out
to intercept the French fleet convoying the Viceroy of Mexico from
Corunna to the West Indies, chased fourteen sail of French ships
into Corunna, but, judging the fortifications too strong to attack
them there, put out to sea, and soon afterwards returned home for
provisions, to the great indignation of the people. Munden was tried
by court-martial and acquitted, but the Prince of Denmark dismissed
him from the service notwithstanding. King William having planned
the reduction of Cadiz, the queen was now advised to put the
project into execution. Sir George Rooke was sent out with a
squadron of fifty ships of the line, besides frigates, fire-ships, and
smaller vessels, and carrying the Duke of Ormond with a land force
of fourteen thousand men. The fleet sailed from St. Helens near the
end of June, and anchored on the 12th of August within two leagues
of Cadiz. The governor of fort St. Catherine was summoned to
surrender, but he refused; and on the 15th the Duke of Ormond
landed under a fire from the batteries, and soon took the forts of St.
Catherine and St. Mary. He issued a proclamation declaring that they
came, not to make war on the Spaniards, but to free Spain from the
yoke of France, and that the people and their property should be
protected. But the English soldiers paid no regard to the
proclamation, but got drunk in the wine stores and committed great
excesses. Some of the general officers were found as eager as the
soldiers for pillaging; and the inhabitants, resenting their sufferings,
held aloof. To complete the mischief, the land and sea commanders,
as has been too commonly the case, fell to quarrelling. Ormond
wanted to storm the Isla de Leon; Rooke deemed it too hazardous.
An attempt was made to batter Matagorda fort, but failed, and the
troops were re-embarked.
As the fleet was returning from its inglorious enterprise, it was met
by Captain Hardy, who informed the commander that the galleons
from the West Indies had entered Vigo Bay under convoy of a
French squadron. A council of war was immediately summoned, and
it was resolved to tack about and proceed to Vigo. They appeared
before the place on the 11th of October. The passage into the
harbour they found strongly defended by forts and batteries on both
sides, and the passage closed by a strong boom of iron chains,
topmasts, and cables. The admirals shifted their flags into smaller
vessels, for neither first nor second rates could enter. Five-and-
twenty English and Dutch ships of the line of lesser size, with their
frigates, fire-ships, and ketches, now prepared to make the attempt
to force the boom and burn the fleet, and the Duke of Ormond
prepared the way by landing two thousand eight hundred men six
miles from Vigo, and marching on the harbour, where he attacked
and carried a strong fort and a platform of forty pieces of cannon at
its mouth. The moment the British colours were seen flying on the
fort the fleet put itself in motion. Admiral Hopson led the way in the
Torbay, and, running with all sail set, dashed against the boom and
burst through it. He was followed by the whole squadron under a
tremendous fire from the ships and batteries; but both ships and
batteries were soon silenced, the batteries by the soldiers on land,
the ships by the fleet. They captured eight ships of war and six
galleons; the rest were set fire to by themselves or the French, to
prevent them from falling into the hands of the English. The
Spaniards had lost no time in removing as much of the plate and
merchandise as they could; but the Allies seized on seven millions of
pieces of eight in plate and other goods, and the Spaniards are
supposed to have saved twice as much. Sir George Rooke left Sir
Cloudesley Shovel, who had just arrived, to bring home the prizes,
and sailed for England with the rest of the fleet and troops in
triumph, complaining that Cadiz, too, might have been taken had
Ormond done his duty, and Ormond retorting the blame upon him.
LORD GODOLPHIN. (After the Portrait by Sir Godfrey Kneller.)
[See larger version]
Had this terminated the usual campaign it might have been
considered, to a certain extent, a success; but an expedition, sent
out to cruise in the waters of the West Indies, under the brave old
Benbow, had a worse fate. He came up with a French fleet under Du
Casse, steering along the shore of Santa Martha, and though he had
ten sail of the line, and the enemy only the same, he found himself
deserted by most of his captains, under the plea that the enemy was
too strong. Benbow, upbraiding their cowardice, attacked the whole
fleet with only two vessels. The battle lasted, off and on, from the
19th of August to the 24th, some others of the ships occasionally
joining him. On the last day his leg was shattered by a chain-shot,
and he was wounded in the face and in the arm; yet he caused
himself to be placed on the quarter-deck in a cradle, and continued
issuing his orders to the last. Seeing it in vain to contend longer, he
returned to Jamaica, and ordered a court-martial to be held. The
reason assigned for the disobedience of the officers was the rough
conduct of Benbow, who was one of the old boisterous school of
seamen, but brave and honest. The disgrace thus inflicted on his
command, combining with his shattered condition, soon also brought
him to his grave.
Marlborough returned to England in November, and was received
with great applause. Notwithstanding some sharp criticisms on his
campaign, the public saw clearly enough that he was a far superior
general to William, and augured great things from his future
command. The queen met her new Parliament on the 20th of
October, which turned out to be so completely Tory as to carry all
before it in that direction. The Government had no occasion to make
much exertion to obtain that result; it was enough that the queen's
decided leaning to the Tories was known. Addresses of
congratulation on the brilliant success of the British arms under
Marlborough were presented by both Houses, which, they said,
"retrieved" the ancient honour and glory of the English nation. This
word "retrieved" roused all the spleen of the Whigs, who knew that
it was meant as a censure on them and King William, who, they
contended, had maintained the honour of the English nation by
joining the great confederacy by which the security of the queen's
throne at that moment was established, and by training our soldiers
to their ancient pitch of discipline and valour. They moved that the
word "maintained" should be substituted for "retrieved," but it was
carried against them, amid the most unmeasured abuse of the
memory of the late king, Marlborough being cried to the skies at his
expense.
The Tories next showed their strength in calling in question various
elections of Whig members, and carried the inquiry against them
with the most open and impudent partiality.
The Commons then voted the supplies, and in practice justified the
Whigs, by being as lavish for the war as they had been. They voted
forty thousand seamen, and the same number of land forces, to act
along with the Allies. They granted eight hundred and thirty-three
thousand eight hundred and twenty-six pounds for their
maintenance; three hundred and fifty thousand pounds for Guards
and garrisons; seventy thousand nine hundred and seventy-three
pounds for ordnance; and fifty-one thousand eight hundred and
forty-three pounds for subsidies to the Allies—altogether, one million
three hundred and six thousand six hundred and forty-two pounds
for the war alone, independent of the usual national expenses, and
these soon required an increase. The queen demanded of the
Commons a further provision for her husband, the Prince of
Denmark, in case of her decease. Howe moved that one hundred
thousand pounds a year should be settled on the prince in case he
should be the survivor. No objection was offered to the amount, but
strenuous opposition was given to a clause in the Bill exempting the
prince from the provision in the Act of Settlement, which prevented
any foreigner, even though naturalised, from holding any
employments under the Crown; but the Court was bent on carrying
this, and did so.
Having secured her husband, Anne then sent a message to the
Commons to inform them that she had created the Earl of
Marlborough a duke for his eminent services, and praying them to
settle five thousand pounds a year on him to enable him to maintain
his new dignity. This was so glaring a case of favouritism that the
Commons, with all their loyalty, expressed their decided
disapprobation. The outcry was so great that the Marlboroughs
declined what they saw no means of getting—the grant—and the
queen intimated that fact to the House; but she immediately offered
her favourites two thousand pounds a year out of her privy purse,
which, with affected magnanimity, they also declined, hoping yet to
obtain, at some more favourable crisis, the Parliamentary grant; and,
after that really happened, they then claimed the queen's offer too.
But the opposition of the Tories, whom Marlborough had been
serving with all his influence in Parliament, alienated him from that
party, and he went over to the Whigs.
What galled Marlborough as much as anything was that he had been
in the House of Lords strongly supporting one of the most illiberal
attempts of the Tories to destroy the effect of the Act of Toleration.
The extreme Tories regarded the Church as entitled to confer all
favours, and they were determined to give it a power by which all
corporations and elections should be thrown into the hands of the
Government. For this purpose Mr. Bromley, Mr. Annesley, and Mr. St.
John, who, as a man of notoriously unorthodox principles, ought at
least to have been tolerant, brought in the Occasional Conformity
Bill. They complained that Dissenters and other disaffected persons
took the oaths, and often went again to the Dissenting meetings;
that this was a gross piece of hypocrisy, and left the Church exposed
to much danger from them. They proposed, therefore, to insist that
all who had taken the Sacrament and test for offices of trust, or for
the magistracy of corporations, and afterwards went to any meeting
of the Dissenters, should forfeit their employments, pay a fine of one
hundred pounds, and five pounds for every day that they continued
to hold their office after having been at a Dissenters' meeting, as
well as be disabled from holding any other employment till after a
year's conformity. The Bill was carried in the Tory Commons by an
overwhelming majority; but it was as strongly opposed in the Lords,
where the Whigs were not disposed to pull down the greatest trophy
of their legislation. The Bishops generally voted against the Bill, and
Burnet was extremely active against it. Probably few of them were
actuated by a sense of the monstrosity of the Test and Corporation
Acts, which compelled all to take the Sacrament, whether opposed
to it in that form or not, and thus shut out the honest and pious, and
let in those who had neither honesty nor religion. But they saw that
it would again let loose all the detestable race of spies and informers
from which the country was now happily free, and would, in reality,
only injure instead of benefiting the Church, by making her an object
of general hatred. The Tories themselves affected great veneration
for the Toleration Act, whilst they would thus have stifled all
toleration.
The queen and the whole Court exerted themselves to force the Bill
through the Upper House, as they had done that for the prince's
salary. Marlborough argued vehemently for it, but the Whig lords hit
upon a way of defeating it by seeming to comply. They agreed to its
passing on condition that all who took the test, and then went to
conventicles, should simply be deprived of their employments and be
fined twenty pounds. They knew that the Commons would not allow
the slightest interference of the Lords with the money part of the
Bill, and this proved to be the case. The Lords searched their rolls,
and showed numerous cases in which they had altered fines, but the
Commons refused to admit any such power. A conference in the
Painted Chamber was held, but with a like result, and after long
contention the Bill was, happily for the nation, dropped.
A Bill was next brought in to allow another year of grace to all who
had not taken the oath abjuring the pretended Prince of Wales. The
Tories contended that the Jacobite party had now come over to the
queen; but it was shown on the other side that this was but a
specious deception; that the agents of St. Germains were in as full
activity as ever; were constantly coming and going; and whilst they
appeared to favour the queen, it was only to get as strong a party as
possible into the House, eventually to abolish both the abjuration
and the Protestant Succession Bill: that to this end they now advised
all persons to take the Abjuration Bill, and to be able to get into
Parliament or power. The Bill was carried in the Commons; but the
Lords again tacked two clauses to it, one declaring it high treason to
endeavour to alter the succession as settled in the Princess Sophia,
and the other to impose the oath on the Irish. These were not
money clauses; whoever refused them must appear disinclined to
the Protestant succession. The Commons were completely
entrapped, and, to the surprise of everybody, they accepted the
clauses, and thus the Bill, which was originally favourable to the
Jacobites, became much more rigid against them. The queen sent
the Lord Keeper, on the 27th of February, 1703, to prorogue
Parliament.
Lord Rochester was now entirely removed from the queen's councils.
His near relationship to the queen, and his being accounted the
champion of the Church, made him presume in the Council, where
he was blustering and overbearing. He was disappointed in not
being placed at the head of the Treasury, and quarrelled continually
with Lord Godolphin. He had now voted against Marlborough's grant
of five thousand pounds a year, and thus incurred the mortal hatred
of the all-powerful Lady Marlborough. It was clear that Rochester
must give way, or the Council must be rent by continual feuds. He
was opposed to the war—another cause of hostility from the
Marlboroughs—to whom it was money, fame, and everything. He
received such intimations from the queen as caused him to retire
into the country in disgust. As he refused all summonses to attend
the Council, her Majesty ordered him to proceed to his government
in Ireland, where his presence was much needed. He replied with
great insolence that he would not go to Ireland, and the post of
Lord-Lieutenant was conferred on the Duke of Ormond. Still
declining to attend the Council, the queen ordered that he should no
more be summoned, and thus terminated Anne's connection with
her relatives by the mother's side. The elder brother of Rochester,
Lord Clarendon, had been excluded the Court for refusing the
abjuration of the pretended Prince of Wales, and his son, Lord
Cornbury, little better than an idiot, was sent to govern the North
American colonies, that he might be out of the way, a system of
colonial management by which these colonies were at length entirely
estranged. Rochester survived this disgrace but a very few weeks.
It was proposed between the Emperor of Germany and the Allies
that the campaign of 1703 should be opened with effect, and by
measures which should go far to paralyse France. The Archduke
Charles, the Emperor's second son, was to declare himself King of
Spain, to propose for the hand of the Infanta of Portugal, and to
proceed to that country to prosecute his claims on Spain by the
assistance of the English and Dutch fleets. Meanwhile the Emperor
promised to take the field with such a force as to drive the Elector of
Bavaria, the active and able ally of France, out of his dominions. But
Louis, as usual, was too rapid in his movements for the slow
Germans. He ordered Marshal Villars, who lay with thirty thousand
men at Strasburg, to pass the Rhine, and advance into Bavaria to
the support of the Elector. The war was thus skilfully diverted by
Louis from the Rhine into the very neighbourhood of the Emperor.
On the other hand, Marlborough, who was the soul of the war on
the Lower Rhine, had been detained by his exertions to counteract
the efforts of Louis XIV. in another quarter. Insurrections had broken
out amongst Louis's Protestant subjects in the Cevennes, who had
been barbarously oppressed. Marlborough, who cared more for the
paralysing of Louis than for the interests of Protestantism, strongly
proposed in the Council that assistance should be sent to the
mountaineers of the Cevennes. This was fighting Louis with his own
weapons, who was exciting insurrection in Hungary and Bohemia
amongst the subjects of the Emperor. Nottingham and others of the
Council as strongly opposed this measure, on the principle of not
exciting subjects against their legitimate sovereign; but Marlborough
prevailed. Arms and ammunition were forwarded to the Cevennes,
and direct communications were ordered to be opened with the
insurgents, which would have compelled Louis to detain a large force
for the subjugation of these rebels, which otherwise would have
gone to the Rhine; but these aids never reached the unfortunate
mountaineers.
Marlborough reached the Hague on the 17th of March, much earlier
still than William used to arrive there. Nor had the war paused for
his arrival. He had stimulated the Prussians to be in action much
earlier. In February they had reduced the fortress of the Rhineberg,
and then proceeded to blockade Guelders, the last place in the
power of France on the frontiers of Spanish Guelderland. It was
fortunate, for the unity of command, that Athlone and Saarbrück,
Marlborough's jealous rivals, were both dead; so that now
Marlborough had only the Dutch camp deputies as clogs on his
movements, but they were quite sufficient often to neutralise his
most spirited projects. He found Villeroi and Boufflers posted on the
frontiers of the Spanish Netherlands, and his design was to attack
and drive them out of Flanders and Brabant. But here, in the very
commencement, he was obliged by the States-General to give up his
own views to theirs. They desired an immediate attack on Bonn,
persuading themselves that the Elector of Cologne would rather
capitulate than risk the ruin of the town. Marlborough went
reluctantly but not inertly into this plan, foreseeing that it would
waste much precious time, and prevent him from falling on Villeroi
and Boufflers at the right moment, when the attempt to support the
Elector of Bavaria had drawn many of their forces away into
Germany. He was the more chagrined the more he saw of the want
of energy in the Allies. He proceeded to Nimeguen to arrange with
Cohorn the plan of the siege of Bonn. He visited and inspected the
garrisons at Venloo, Ruremond, Maestricht, and the other places
which he took in the previous campaign on the Meuse. Arriving at
Cologne, he found preparations made for a siege, but in a most
negligent manner; and Cohorn especially excited his disgust by
proposing to defer the siege of this place till the end of summer. But
Marlborough knew too well the necessity of preventing an attack
from that quarter; ordered the place to be invested, and then
marched on Bonn with forty battalions, sixty squadrons, and a
hundred pieces of artillery. The trenches were opened on the 3rd of
May, and it was assaulted from three different quarters at once; on
one side by the forces under the hereditary prince of Hesse-Cassel,
on another by those under Cohorn, and on the third by Lieutenant-
General Fagel. The city capitulated on the 15th, and the commander,
the Marquis D'Allegré, and his garrison were conducted to
Luxemburg. During the siege continually arrived the news of the
successes of the Elector of Bavaria, and the failures of the Imperial
troops; and Villeroi and Boufflers advanced, took Tongres, and
menaced the Allies from that quarter with forty thousand men.
H.R.H. THE PRINCESS ANNE OF DENMARK, AFTERWARDS QUEEN OF
ENGLAND.
From the Painting by W. Wissing and J. Vandervaart.
[See larger version]
No sooner was Bonn reduced than Marlborough determined to
prosecute his original plan of driving the French from Flanders. He
now dispatched Cohorn, Spaar, and Opdam to commence operations
at Bergen-op-Zoom, whilst he addressed himself to dislodge Villeroi
and Boufflers from Tongres. In order to divide the energies of the
French, a part of his plan was that the powerful English and Dutch
fleet was to keep the coast of that country in alarm from Calais to
Dieppe, and actually to make a descent on the land near the latter
port. But the French resolved to cut off the division of Opdam from
the main army. Boufflers, with twenty thousand men, surprised him,
and the Dutch falling into confusion, Opdam believed the day lost,
and fled to Breda.

VIEW IN LISBON: THE PRÁÇA DE DOM PEDRO.


[See larger version]
Opdam's miscarriage had greatly deranged Marlborough's plan of
attack on Antwerp. Spaar and Cohorn were already near Antwerp
with their united forces, but the check received by Opdam's division
delayed the simultaneous advance. Villeroi lay in the path of
Marlborough near St. Job, and declared that he would wait for him;
but the moment the duke advanced to Hoogstraat to give him battle,
he set fire to his camp and retreated within his lines with all haste.
Boufflers had joined Bedmar in Antwerp, and Marlborough advanced
and laid siege to Huy, which surrendered on the 27th of August. He
now called a council of war to decide the plan of attack on Antwerp,
and was well supported by the Danish, Hanoverian, and Hessian
generals, but again found opposition from the Dutch officers and the
deputies of the States, who deemed the attempt too dangerous.
They recommended him to attempt the reduction of Limburg, by
which they would acquire a whole province; and despairing now of
accomplishing his great object, the reduction of Antwerp, this
campaign—having the Dutch officers, the Dutch deputies, and the
Dutch Louvestein faction all working against him—he turned aside to
Limburg, and reduced it in a couple of days. This acquisition put into
the power of the Allies the whole country from Cologne, including
Liége; and Guelders being afterwards stormed by the Prussian
General Lottum, the whole of Spanish Guelderland remained theirs.
Elsewhere the war went in favour of the French, and the affairs of
the Emperor never appeared more gloomy; instead of recovering
Spain, Louis was fast depriving him of his Empire. He was supporting
against him the rebellious Hungarians, who were in arms under
Prince Ragotski, and who had plenty of oppressions to complain of.
Suddenly, however, some gleams of light shot across his gloom. The
Duke of Savoy, who seldom remained true to one side long, grew
alarmed at the French being masters of the Milanese, and was
induced to open communications with the Emperor. But the secret
negotiations were speedily discovered by the French, and the Duke
of Vendôme received orders to disarm the Savoyards who were in
his army; to demand that the troops of Savoy should be reduced to
the scale of 1696, and that four principal fortresses should be put
into the hands of France. But the Duke of Savoy was by no means
inclined to submit to these demands. He treated them as insults to
an ally, and ordered the arrest of the French ambassador and several
officers of his nation. Louis, astonished at the decision of these
proceedings, wrote the duke a most menacing letter, informing him
that as neither honour, interest, religion, nor the oaths of alliance
were regarded by him, he should leave the Duke of Vendôme to deal
with him, who would give him four-and-twenty hours to determine
his course in. This imperious letter only hastened the duke's
alienation. He concluded the treaty with Vienna, and answered
Louis's letter by a defiance. He acknowledged the Archduke Charles
King of Spain, and despatched envoys to Holland and England.
Queen Anne immediately sent an ambassador to Turin; and a body
of Imperial horse under Visconti, followed by fifteen thousand foot
under Count Staremberg, issued from the Modenese, and in the
midst of the most stormy weather and through miry roads marched
to join the Duke of Savoy at Canelli. The French harassed them
fearfully on the march, but could not prevent their junction, by
which Piedmont was placed in security.
In the same way, Portugal had declared for the Emperor. The fear of
having Louis in possession of Spain had operated with Portugal, as
similar causes had operated with Savoy. The King of Portugal agreed
to give his daughter to the Archduke Charles, on condition that the
right to the throne of Spain was transferred to him. England and
Holland were to support the Portuguese and the new King of Spain
from the sea. The treaty was concluded at Lisbon, and a fleet of
forty-nine sail, under Sir Cloudesley Shovel, lay off Lisbon to protect
the coasts from the French. Charles was to be conveyed to Lisbon by
a powerful fleet, having on board twelve thousand soldiers, who
were, on landing, to be joined by twenty-eight thousand Portuguese.
The allied fleets had done nothing of importance during this summer.
The Archduke Charles, having assumed the title of King of Spain, set
out from Vienna about the middle of September, and reached
Düsseldorf on the 16th of October, where he was met by the Elector
Palatine and the Duke of Marlborough, who was commissioned by
Queen Anne to offer his congratulations. Marlborough accompanied
Charles of Austria to the Hague, where they were both received with
high honours by the States-General. Marlborough then hastened
over to England to be ready to receive the royal guest on his way to
Portugal. On the 26th of December the new King of Spain arrived at
Spithead in the Dutch squadron sent to convey him. The queen
dispatched the Dukes of Somerset and Marlborough to conduct him
to Windsor, and Prince George met him on the way at Petworth, the
seat of the Duke of Somerset, and conducted him to Windsor on the
29th. The king was entertained in great state for three days at
Windsor, during which time he was politic enough to ingratiate
himself with the Duchess of Marlborough. When the duchess
presented the bason and napkin after supper to the queen for her to
wash her hands, the king gallantly took the napkin and held it
himself, and on returning it to the queen's great favourite, he
presented her with a superb diamond ring.
After three days the king returned to Portsmouth, and on the 4th of
January, 1704, he embarked on board the fleet commanded by Sir
George Rooke, for Portugal, accompanied by a body of land forces
under the Duke of Schomberg. The voyage was, however, a most
stormy one, and when the fleet had nearly reached Cape Finisterre,
it was compelled to put back to Spithead, where it remained till the
middle of February. His next attempt was more successful, and he
landed in Lisbon amid much popular demonstration, though the
Court itself was sunk in sorrow by the death of the Infanta, whom
he went to marry.
Before the arrival of Charles in England, it had been visited by one of
the most terrible storms on record. The tempest began on the 27th
of November, 1703, attended by such thunder and lightning as had
never been experienced by living man. The Thames overflowed its
banks, and was several feet deep in Westminster Hall. The houses in
London seemed shaken from their foundations, and many actually
fell, burying the inhabitants in their ruins. The loss in London alone
was estimated at a million sterling, and the storm raged with equal
fury in other places. Bristol was a great sufferer; but the greatest
destruction fell on the fleet. Thirteen ships of war were lost, and
fifteen hundred seamen, including Rear-Admiral Beaumont, who
foundered in the Downs. Many of the oldest trees in the parks were
torn up, and the lead on the churches was rolled up in scrolls. This
unparalleled storm raged most fiercely along the southern and
western counties, being scarcely felt in the northern ones. The
Bishop of Bath and Wells, with his wife, was killed in the episcopal
palace by the fall of a stack of chimneys.
The queen opened Parliament on the 9th of November. She spoke of
the new treaties with the Duke of Savoy and the King of Portugal as
subjects of congratulation; and on the 12th the Lords presented an
address to the queen, expressing their satisfaction at her having
entered into these treaties, and even displayed a zeal beyond them.
The Commons on their part voted fifty-eight thousand soldiers and
forty thousand sailors as the standard of the army and navy, and
they granted the requisite supplies with the utmost readiness. No
sooner was this patriotic demonstration made, than the Commons
again introduced the Occasional Conformity Bill, and carried it by a
large majority, on pretence that the Church was in danger; but the
Lords attacked it with greater animosity than ever, and threw it out.
At this moment the nation became alarmed with the rumour of a
conspiracy amongst the Jacobites in Scotland. When the queen, on
the 17th of December, went to the Lords to give her assent to the
Land Tax Bill, she informed them that she had made discoveries of a
seditious nature in Scotland, which, as soon as it could be done with
prudence, she assured them should be laid before them. The Lords,
in their loyalty, were not disposed to wait for these disclosures, but
appointed a Committee to inquire into the plot, and even went so far
as to take some of the parties implicated out of the hands of the
queen's messengers, to examine them themselves.
The year 1704 opened amid these inquiries. The Queen laid before
the House of Lords the papers concerning the Highland plot, with
one exception, which the Earl of Nottingham asserted could not yet
be made public without tending to prevent further discovery. This
only stimulated the Lords, who addressed the queen, praying that
the whole of the papers might be submitted to them. The queen
replied that she did not expect to be pressed in this manner, but she
ordered the papers in question to be delivered to them under seal.
The Peers pursued the inquiry with renewed vigour, and soon issued
a report that it appeared to them that there had been a dangerous
conspiracy, instigated by Simon Fraser, Lord Lovat, carried on for
raising a rebellion in Scotland, and invading that kingdom with
French forces, in order to subvert her Majesty's Government and
bring in the pretended Prince of Wales, and that they were of
opinion that nothing had given so much encouragement to this
conspiracy as the Scots not coming into the Hanover succession as
fixed in England. They therefore besought the queen to procure the
settlement of the Crown of Scotland on the Princess Sophia, and
when that was done they would use all their influence for a union of
the two kingdoms.
Anne expressed her entire concurrence in these views, and the Lords
then presented another address in answer to the second address of
the Commons. They charged the Commons with manifesting a want
of zeal for the queen's safety, and with showing a strange reluctance
that the particulars of the plot should be brought to light,
obstructing all through, as much as in them lay, the necessary
inquiry; and fresh fuel was immediately furnished to the flame
already blazing between the two Houses. One Matthew Ashby, a
freeman of Aylesbury, brought an action against William White and
others, the constables of Aylesbury, for preventing him from
exercising his franchise at the last election. This was an unheard-of
proceeding, all matters relating to elections being from time
immemorial referred to the House of Commons itself. The
circumstances of the case, however, furnished some reason for this
departure from the rule. It appeared that four constables made the
return, who were known to have bargained with a particular
candidate, and to have so managed that the election should be his.
In appeals to the Commons the party which happened to be in
power had in a most barefaced manner always decided in favour of
the man of their own side. Ashby, therefore, sought what he hoped
would prove a more impartial tribunal. He tried the cause at the
assizes, and won it; but it was then moved in the Queen's Bench to
quash these proceedings as novel and contrary to all custom. Three
of the judges were opposed to hearing the case, the matter
belonging notoriously to the House of Commons; and they argued
that, if this practice were introduced, it would occasion a world of
suits, and make the office of returning members a very dangerous
one. The Lord Chief Justice Holt alone was in favour of it. He
contended that there was a great difference between the election of
a member and a right to vote. The decision of the election
undoubtedly belonged to the Commons, but the right to vote being
founded upon a forty-shilling freehold, upon burgage land, upon a
prescription, or the charter of a borough, was clearly establishable
by a court of law. The judges at length permitted the trial, but, being
three against one, the decision was for the constables. This aroused
the indignation of the whole Whig party, and the cause was removed
by a writ of error to the House of Lords. The Lords, after a full
hearing, and taking the opinions of the judges, confirmed the
judgment given in favour of Ashby at the assizes.
The Commons now took up the affair with great warmth. They
passed five resolutions—namely, that all matters relating to elections
and the right of examining and determining the qualifications of
electors belonged solely to them; that Ashby was guilty of a breach
of their privileges, and they denounced the utmost weight of their
resentment against all persons who should follow his example and
bring any such suit into a court of law, as well as against all counsel,
attorneys, or others who should assist in such suit. They ordered
these resolutions to be affixed to the gates of Westminster Hall. The
Lords took instant measures to rebut these charges. They appointed
a committee to draw up a statement of the case, and resolved upon
its Report "that every person being wilfully hindered from exercising
his right of voting might seek for justice and redress in common
courts of law against the officer by whom his vote had been refused;
that any assertion to the contrary was destructive of the property of
the subject, against the freedom of election, and manifestly tending
to the encouragement of bribery and corruption; and finally that the
declaring Matthew Ashby guilty of a breach of privilege of the House
of Commons was an unprecedented attempt upon the Judicature of
Parliament in the House of Lords, and an attempt to subject the law
of England to the will and votes of the Commons."
They ordered the Lord-Keeper to send copies of the case and their
votes to all the Sheriffs of England, to be by them communicated to
the boroughs in their respective counties. The House of Commons
was greatly enraged at this, but it had no power to prevent it, and it
had the mortification to see that the public feeling went entirely with
the Lords, who certainly were the defenders of the rights of the
subject, whilst the Commons, corruptly refusing a just redress to
such appeals, endeavoured to prevent the sufferers from obtaining it
anywhere else.
One of the most striking acts of this reign was the grant of the first-
fruits and tenths of church livings to the poor clergy. The tenths
were about eleven thousand pounds a year, and the first-fruits about
five thousand pounds. These moneys had been collected by the
bishops since the Reformation and paid to the Crown. They had
never, says Burnet, "been applied to any good use, but were still
obtained by favourites for themselves and friends, and in King
Charles's time went chiefly amongst his women and children. It
seemed strange that, whilst the clergy had much credit at Court,
they had never resented this as sacrilege unless it were applied to
some religious purpose, and that during Archbishop Laud's favour
with King Charles I., or at the restoration of King Charles II., no
endeavours had been used to appropriate this to better uses;
sacrilege was charged on other things on very slight grounds, but
this, which was more visible, was always forgot." But the fund was
too convenient a fund for favourites to get grants upon. It is much to
the credit of Burnet that he managed to divert this misused fund
from the greedy clutches of courtiers and mistresses, to the
amelioration of the condition of the unhappy working clergy. He
proposed the scheme first to William, who listened to it readily,
being assured by Burnet that nothing would tend to draw the hearts
of the clergy so much towards him, and put a stop to the groundless
clamour that he was the enemy of the clergy. Somers and Halifax
heartily concurred in the plan; but the avaricious old Sunderland got
a grant of it upon two dioceses for two thousand pounds a year for
two lives, which frustrated the aims of the reformers. Burnet,
however, succeeded better with Anne. He represented that there
were hundreds of cures that had not twenty pounds a year, and
some thousands that had not thirty pounds, and asked what could
the clergy be or do under such circumstances? Therefore, on the 7th
of February, 1704, Sir Charles Hedges, the Secretary of State,
announced to the Commons that her Majesty had remitted the
arrears of the tenths to the poor clergy, and had resolved to grant in
future the whole of the first-fruits and tenths for the augmentation
of small livings. The Commons replied in an address, expressing
their sense of her pious care for the Church, and brought in a Bill to
enable her to alienate this branch of the revenue, and to create a
corporation by charter, to apply the money, according to the queen's
intention, in increasing the wretched stipends of the poorer clergy.
There was an attempt made to relieve the clergy altogether from the
payment of first-fruits and tenths, and to devote some other fund to
the relief of the poor clergy; but as Anne's intention was not to
relieve the rich but to comfort the poor, she would not listen to it.
The Statute of Mortmain was also relaxed by a provision of the Bill,
so far as to allow individuals to make augmentations to benefices by
deed of gift or by bequest. The Bishops were unanimous for the Bill,
and addresses of thanks from all the clergy of England were
presented to Anne on the occasion of this noble gift of what has
been ever since known as Queen Anne's Bounty. However, Anne was
far from being so generous to Dissenters, or to any other sect in the
kingdom. On the contrary, she had just before allowed the
Parliament of Ireland to stop the poor sum of twelve hundred
pounds per annum, which had been paid by the late king to the
indigent Presbyterian ministers of Ulster, who had so manfully
defended the north of Ireland against James.
THE KING OF SPAIN AT WINDSOR: HIS GALLANTRY TO THE DUCHESS
OF MARLBOROUGH. (See p. 546.)
[See larger version]
On the 3rd of April the queen prorogued Parliament till the 4th of
July. The Convocation had during this time kept up its bitter
controversy, and had done nothing more except thank the queen for
the grant of the first-fruits and tenths, and the Commons for having
espoused their cause.
Marlborough had left London for the Hague on the 15th of January
whilst Parliament was sitting. He was promised fifty thousand British
troops under his own immediate command, and he was planning a
campaign which gave the first evidence of a real military genius
being at the head of the Allied forces, since these Dutch wars began.
He saw that the Elector of Bavaria, by his alliance with the French,
was striking at the very heart of the Empire, and that, if permitted to
continue his plans, he would soon, with his French allies, be in
possession of Vienna. Nothing could be more deplorable than the
condition of Austria. Besides the successes of the Elector of Bavaria,
the insurgents of Hungary were triumphant, and between the two
the Empire was on the verge of ruin. The Elector of Bavaria had
possessed himself of all the places on the Danube as far as Passau,
and should he come to act in concert with the Hungarians, Vienna
would be lost. Prince Eugene put himself into communication with
Marlborough, and these two great generals determined on striking a
blow which should at once free Austria from its dangers. This was no
other than a bold march of a powerful army to the Danube, and the
destruction of the Elector of Bavaria.
This was a design so far out of the mediocre range of Dutch
campaigns that it was determined not to let its real character
become known till it could be instantly put in execution, certain that
the States-General, terrified at so daring a scheme, would prohibit it
at once. To go securely to work, therefore, by the advice of Eugene,
the Emperor applied to the Queen of England to send an army to his
rescue. Marlborough supported the application with all his energy,
and, having procured the queen's consent, he left England on the
15th of January, was in the Hague on the 19th, and put himself into
secret communication with the Grand Pensionary Heinsius. He fully
approved of the scheme, and promised to give it his most strenuous
support. It was thought, however, imprudent to confide the real
extent of the plan to other persons, not only because it was sure to
alarm the States-General, but because it had been all along
observed that every proposal, as soon as it became known to the
Government or heads of the army, was immediately treacherously
conveyed to the French. The proposal made to the States-General,
therefore, was merely that the next campaign should be made on
the Moselle, as if the design were to penetrate into France along
that river.
The States-General, as was expected, appeared thunderstruck by
even the proposal of carrying the war to the Moselle, and it was only
by the zeal of Heinsius that they were brought to consent to it. That
accomplished, they were induced to grant a subsidy to the Prince of
Baden, and another to the Circle of Suabia, and to take into pay four
thousand Würtembergers instead of the same number of Dutch and
English despatched to Portugal. There was a promise of money
given to the Prince of Savoy, with an assurance of so vigorous a
campaign on this side of the Alps that the French should not be able
to send many troops against him. Similar assurances of co-operation
were given to the Elector Palatine and to the new King of Prussia.
These matters being arranged, Marlborough hastened back to
England, and persuaded the queen to remit a hundred thousand
crowns to Suabia, and to make a large remittance to the Prince of
Baden out of the privy purse. He then put himself on a good
understanding with the now partly Whig Ministry, himself as well as
his indefatigable duchess coming out in Whig colours. He then
returned to the Netherlands in the beginning of April. He found in his
absence that the terms of his design, little of it as was known, had
been actively operating in the cautious Dutch mind, and the States
of Zealand and Friesland in particular were vehemently opposed to
so bold a measure as carrying the war to the Moselle. Marlborough,
who had brought with him to support him in command his brother
General Churchill, Lieutenant-General Lumley, the Earl of Orkney,
and other officers of distinction, told the States plainly that he had
the authority of his queen for taking such measures as he thought
best for the common cause, and that he was determined to march
with his forty thousand men to the Moselle. This struck with silence
the opposers of the measure: the States consented with a good
grace to the proposition, and gave him such powers as they never
would have done had they any idea to what an extent he meant to
use them. Prince Eugene alone, who was commanding the Allied
army on the Upper Danube, was in the secret. Leaving Overkirk with
a strong force to guard the frontiers of Holland, he commenced at
once his march to Utrecht, where he spent a few days with
Albemarle, thence to Ruremond, and so to Maestricht, and on the
8th of May advanced to Bedburg, in the Duchy of Juliers, which had
been appointed as the place of rendezvous. There he found General
Churchill with fifty-one battalions, and ninety-two squadrons of
horse.
Being joined by various detachments of Prussians, Hessians,
Lüneburgers, and others, and also by eleven Dutch battalions,
Marlborough, on the 19th of May, commenced his great expedition
into the heart of Germany. On the 26th he was at Coblentz, and
from the grand old fortress of Ehrenbreitstein he watched the
passage of his army over the Moselle and the Rhine. He wrote to the
States-General for fresh reinforcements in order to secure his most
important movement, and marched along the banks of the Rhine to
Broubach. There he also wrote to the King of Prussia, praising the
Prussian troops, and entreating him to send him more of them.
While he was at Mainz, he halted a day to rest his troops, and there
received the agreeable news that the States were sending after him
twenty squadrons, and eight battalions of Danish auxiliaries; but at
the same time he was mortified to find that the Prince of Baden had
managed so badly as to allow the ten thousand troops forwarded by
Tallard to join the Elector of Bavaria without molestation, and had
lost the most tempting opportunities, whilst the Elector was
marching through narrow defiles, of cutting off his march and
reducing him to extremities.
The French were filled with wonder at this march of Marlborough,
far out from the usual scene of the English operations, and could not
for some time realise the object of it. At one time they expected only
an attack on the Moselle, but that river and the Rhine being crossed,
they apprehended that his design was to raise the siege of Landau,
and this was confirmed by the advance of the Landgrave of Hesse to
Mannheim. But when he crossed the Neckar and advanced on
Erpingen, and was continually strengthened by fresh junctions of
Prussians, Hessians, and Palatines, they began to comprehend his
real object. He waited at Erpingen for the coming up of General
Churchill with the artillery and part of the infantry, and he employed
the time in sending a despatch to warn the Prince of Baden that
Tallard and Villeroi were about to unite their armies, pass the Rhine,
and hasten to the support of the Elector of Bavaria. He pressed on
the prince the extreme importance of preventing this passage of the
French army. He told him that they must not trouble themselves
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebooksecure.com

You might also like