80% found this document useful (5 votes)
474 views53 pages

Java Programming (MindTap Course List), 10th Edition Joyce Farrell - Ebook PDF Download

The document is a promotional listing for the 10th edition of 'Java Programming' by Joyce Farrell, available as an eBook PDF. It includes links to download this edition and other related educational materials. The content outlines various chapters and topics covered in the book, emphasizing its focus on Java programming concepts and practices.

Uploaded by

gmkuelkbum2882
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
80% found this document useful (5 votes)
474 views53 pages

Java Programming (MindTap Course List), 10th Edition Joyce Farrell - Ebook PDF Download

The document is a promotional listing for the 10th edition of 'Java Programming' by Joyce Farrell, available as an eBook PDF. It includes links to download this edition and other related educational materials. The content outlines various chapters and topics covered in the book, emphasizing its focus on Java programming concepts and practices.

Uploaded by

gmkuelkbum2882
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/ 53

Java Programming (MindTap Course List), 10th

Edition Joyce Farrell - eBook PDF pdf download

https://ebooksecure.com/download/java-programming-mindtap-course-
list-10th-edition-ebook-pdf/

Download more ebook instantly today - get yours now at ebooksecure.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Java Programming 9th Edition Joyce Farrell - eBook PDF

https://ebooksecure.com/download/java-programming-ebook-pdf/

ebooksecure.com

Programming Logic & Design, Comprehensive 9th edition


Joyce Farrell - eBook PDF

https://ebooksecure.com/download/programming-logic-design-
comprehensive-9th-edition-ebook-pdf/

ebooksecure.com

Programming Logic and Design, Comprehensive 9th Edition


Joyce Farrell - eBook PDF

https://ebooksecure.com/download/programming-logic-and-design-
comprehensive-9th-edition-ebook-pdf/

ebooksecure.com

(eBook PDF) Management across Cultures - Australasian


Edition

https://ebooksecure.com/product/ebook-pdf-management-across-cultures-
australasian-edition/

ebooksecure.com
Statistics for Business & Economics 14e Edition David R.
Anderson - eBook PDF

https://ebooksecure.com/download/statistics-for-business-economics-
ebook-pdf-2/

ebooksecure.com

(Original PDF) Fundamentals of Human Resource Management


5th by Gary Dessler

https://ebooksecure.com/product/original-pdf-fundamentals-of-human-
resource-management-5th-by-gary-dessler/

ebooksecure.com

(eBook PDF) Data Analytics for Accounting 2nd Edition By


Vernon Richardson

https://ebooksecure.com/product/ebook-pdf-data-analytics-for-
accounting-2nd-edition-by-vernon-richardson/

ebooksecure.com

(eBook PDF) Principles of International Taxation 6th


Edition

https://ebooksecure.com/product/ebook-pdf-principles-of-international-
taxation-6th-edition/

ebooksecure.com

Business Ethics: Cases, Issues & Stakeholders (Textbook)


13th Edition Sharon Hanna-West - eBook PDF

https://ebooksecure.com/download/business-ethics-cases-issues-
stakeholders-textbook-ebook-pdf/

ebooksecure.com
(eBook PDF) Applied Predictive Modeling 2nd 2018 Edition

https://ebooksecure.com/product/ebook-pdf-applied-predictive-
modeling-2nd-2018-edition/

ebooksecure.com
Java
Programming
Tenth Edition

Joyce Farrell

Australia • Brazil • Canada • Mexico • Singapore • United Kingdom • United States

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.

Important Notice: Media content referenced within the product description or the product
text may not be available in the eBook version.

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
JavaTM Programming, Tenth Edition © 2023, © 2019, © 2016 Cengage Learning, Inc. WCN: 02-300
Joyce Farrell ALL RIGHTS RESERVED. No part of this work covered by the copyright herein
may be reproduced or distributed in any form or by any means, except as
SVP, Higher Education Product Management: Erin
permitted by U.S. copyright law, without the prior written permission of the
Joyner
copyright owner.
VP, Product Management, Learning Experiences: Unless otherwise noted, all content is Copyright © Cengage Learning, Inc.
Thais Alencar
Unless otherwise noted, all screenshots are courtesy of Microsoft Corporation.
Product Director: Mark Santee
Microsoft is a registered trademark of Microsoft Corporation in the U.S.
Associate Product Manager: Tran Pham and/or other countries.

The names of all products mentioned herein are used for identification
Product Assistant: Ethan Wheel
purposes only and may be trademarks or registered trademarks of their
Learning Designer: Mary Convertino respective owners. Cengage Learning disclaims any affiliation, association,
connection with, sponsorship, or endorsement by such owners.
Senior Content Manager: Maria Garguilo

Associate Digital Delivery Quality Partner: David For product information and technology assistance, contact us at
O’Connor Cengage Customer & Sales Support, 1-800-354-9706
or support.cengage.com.
Technical Editor: John Freitas
For permission to use material from this text or product, submit all
Developmental Editor: Dan Seiter
requests online at www.copyright.com.

VP, Product Marketing: Jason Sakos


Library of Congress Control Number: 2021925780
Director, Product Marketing: April Danaë
ISBN: 978-0-357-67342-3
Portfolio Marketing Manager: Mackenzie Paine
Cengage
IP Analyst: Ann Hoffman
200 Pier 4 Boulevard
IP Project Manager: Integra Software Services Boston, MA 02210
USA
Production Service: Straive
Cengage is a leading provider of customized learning solutions with
Senior Designer: Erin Griffin employees residing in nearly 40 different countries and sales in more than
125 countries around the world. Find your local representative at
Cover Image Source: iStock.com/gremlin
www.cengage.com.

To learn more about Cengage platforms and services, register or access


your online learning solution, or purchase materials for your course, visit
www.cengage.com.

Notice to the Reader


Publisher does not warrant or guarantee any of the products described herein or perform any independent analysis in connection with
any of the product information contained herein. Publisher does not assume, and expressly disclaims, any obligation to obtain and
include information other than that provided to it by the manufacturer. The reader is expressly warned to consider and adopt all safety
precautions that might be indicated by the activities described herein and to avoid all potential hazards. By following the instructions
contained herein, the reader willingly assumes all risks in connection with such instructions. The publisher makes no representations
or warranties of any kind, including but not limited to, the warranties of fitness for particular purpose or merchantability, nor are any
such representations implied with respect to the material set forth herein, and the publisher takes no responsibility with respect to
such material. The publisher shall not be liable for any special, consequential, or exemplary damages resulting, in whole or part, from
the readers’ use of, or reliance upon, this material.

Printed in the United States of America


Print Number: 01   Print Year: 2022

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
BRIEF CONTENTS
PREFACEXI

CHAPTER 1 Creating Java Programs�������������������������������������������������������������������������������� 1


CHAPTER 2 Using Data���������������������������������������������������������������������������������������������������� 39
CHAPTER 3 Using Methods�������������������������������������������������������������������������������������������� 83
CHAPTER 4 Using Classes and Objects����������������������������������������������������������������������� 115
CHAPTER 5 Making Decisions�������������������������������������������������������������������������������������� 161
CHAPTER 6 Looping������������������������������������������������������������������������������������������������������� 201
CHAPTER 7 Characters, Strings, and the StringBuilder�������������������������������������� 237
CHAPTER 8 Arrays��������������������������������������������������������������������������������������������������������� 267
CHAPTER 9 Inheritance and Interfaces����������������������������������������������������������������������� 329
CHAPTER 10 Exception Handling��������������������������������������������������������������������������������� 393
CHAPTER 11 File Input and Output����������������������������������������������������������������������������� 441
CHAPTER 12 Recursion������������������������������������������������������������������������������������������������� 487
CHAPTER 13 Collections and Generics����������������������������������������������������������������������� 511
CHAPTER 14 Introduction to Swing Components���������������������������������������������������� 545
APPENDIX A Working with the Java Platform ����������������������������������������������������������� 587

APPENDIX B Data Representation ����������������������������������������������������������������������������� 591

APPENDIX C Formatting Output �������������������������������������������������������������������������������� 595

APPENDIX D Generating Random Numbers ������������������������������������������������������������ 603

APPENDIX E Javadoc ���������������������������������������������������������������������������������������������������� 607

APPENDIX F Using JavaFX and Scene Builder ����������������������������������������������������������� 613

GLOSSARY 625
INDEX 641

iii

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS
PREFACEXI Key Terms 32
Review Questions 33
CHAPTER 1 Programming Exercises 34
Debugging Exercises 36
CREATING JAVA PROGRAMS 1
Game Zone 36
1.1 Learning Programming Terminology 1 Case Problems 37
1.2 Comparing Procedural and Object-
Oriented Programming Concepts 4
CHAPTER 2
Procedural Programming 4
Object-Oriented Programming 5 USING DATA 39
Understanding Classes, Objects, and Encapsulation 6
2.1 Declaring and Using Constants
Understanding Inheritance and Polymorphism 7
and Variables 39
1.3 Features of the Java Programming Declaring Variables 40
Language8
Declaring Named Constants 42
1.4 Analyzing a Java Application That The Scope of Variables and Constants 43
Produces Console Output 10
Concatenating Strings to Variables and
Understanding the Statement That Produces the Constants 43
Output10
Pitfall: Forgetting That a Variable Holds One
Understanding the First Class 12 Value at a Time 45
Understanding the main() Method 14
2.2 Learning About Integer Data
Indent Style 15
Types47
Saving a Java Class 16
2.3 Using the boolean Data Type 51
1.5 Compiling a Java Class and
Correcting Syntax Errors 18 2.4 Learning About Floating-Point
Compiling a Java Class 18 Data Types 52
Correcting Syntax Errors 19 2.5 Using the char Data Type 53
1.6 Running a Java Application and 2.6 Using the Scanner Class to
Correcting Logic Errors 23 Accept Keyboard Input 57
Running a Java Application 23 Pitfall: Using nextLine() Following One of the
Modifying a Compiled Java Class 23 Other Scanner Input Methods 59
Correcting Logic Errors 24
2.7 Using the JOptionPane Class to
1.7 Adding Comments to a Java Class 25 Accept GUI Input 64
1.8 Creating a Java Application That Using Input Dialog Boxes 64
Produces GUI Output 27 Using Confirm Dialog Boxes 66
1.9 Finding Help 29 2.8 Performing Arithmetic Using
Variables and Constants 68
Don’t Do It 30 Associativity and Precedence 69
Summary31 Writing Arithmetic Statements Efficiently 69

iv

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents v

Pitfall: Not Understanding Imprecision in Game Zone 113


Floating-Point Numbers 70 Case Problems 114
2.9 Understanding Type Conversion 72
Automatic Type Conversion 73 CHAPTER 4
Explicit Type Conversion 73
USING CLASSES AND OBJECTS 115
Don’t Do It 76 4.1 Learning About Classes
Summary 77 and Objects 115
Key Terms 77 4.2 Creating a Class 117
Review Questions 78
Programming Exercises 80
4.3 Creating Instance Methods
in a Class 119
Debugging Exercises 81
Game Zone 81 4.4 Declaring Objects and
Case Problems 82 Using Their Methods 124
Understanding Data Hiding 126

CHAPTER 3 4.5 Understanding That Classes


Are Data Types 128
USING METHODS 83 4.6 Creating and Using Constructors 131
3.1 Understanding Method Calls and Creating Constructors with Parameters 132
Placement83
4.7 Learning About the this
3.2 Understanding Method Reference134
Construction86 Using the this Reference to Make
Access Specifiers 86 Overloaded Constructors More Efficient 137
The static Modifier 87
4.8 Using static Fields 139
Return Type 87
Using Constant Fields 140
Method Name 87
Parentheses 88 4.9 Using Imported, Prewritten
Constants and Methods 143
3.3 Adding Parameters to Methods 91
The Math Class 144
Creating a Method That Receives a Single
Importing Classes That Are Not Imported
Parameter 91
Automatically 145
Creating a Method That Requires Multiple
Using the LocalDate Class 146
Parameters 94

3.4 Creating Methods That 4.10 U


 nderstanding Composition
Return Values 95 and Nested Classes 150
Composition 150
3.5 Understanding Blocks and Scope 99
Nested Classes 151
3.6 Overloading a Method 104
3.7 Learning about Ambiguity 107 Don’t Do It 153
Summary 153
Don’t Do It 108 Key Terms 154
Summary 108 Review Questions 154
Key Terms 109 Programming Exercises 156
Review Questions 109 Debugging Exercises 158
Programming Exercises 111 Game Zone 158
Debugging Exercises 113 Case Problems 159

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
vi Contents

CHAPTER 5 CHAPTER 6
MAKING DECISIONS 161 LOOPING201
5.1 Planning Decision-Making Logic 161 6.1 Learning About the Loop
5.2 The if and if…else Statements 163 Structure201
The if Statement 163 6.2 Creating while Loops 202
Pitfall: Misplacing a Semicolon in an if Statement 164 Writing a Definite while Loop 202
Pitfall: Using the Assignment Operator Instead Pitfall: Failing to Alter the Loop Control Variable
of the Equivalency Operator 165 Within the Loop Body 204
Pitfall: Attempting to Compare Objects Using Pitfall: Unintentionally Creating a Loop with
the Relational Operators 165 an Empty Body 204
The if…else Statement 166 Altering a Definite Loop’s Control Variable 206
Writing an Indefinite while Loop 206
5.3 Using Multiple Statements in
if and if…else Clauses 168 Validating Data 208

5.4 Nesting if and if…else 6.3 Using Shortcut Arithmetic


Statements172 Operators210
5.5 Using Logical AND and OR 6.4 Creating a for Loop 214
Operators174 Variations in for Loops 215
The AND Operator 174 6.5 Learning How and When to Use
The OR Operator 175 a do…while Loop 217
Short-Circuit Evaluation 175 6.6 Learning About Nested Loops 220
5.6 Making Accurate and Efficient 6.7 Improving Loop Performance 223
Decisions178 Avoiding Unnecessary Operations 223
Making Accurate Range Checks 178 Considering the Order of Evaluation of
Making Efficient Range Checks 180 Short-Circuit Operators 224
Using && and || Appropriately 180 Comparing to Zero 224
5.7 Using switch  181 Employing Loop Fusion 226
Using the switch Expression 183 A Final Note on Improving Loop Performance 226

5.8 Using the Conditional and NOT


Operators186 Don’t Do It 228
Summary 228
Using the NOT Operator 187
Key Terms 229
5.9 Understanding Operator
Review Questions 229
Precedence187
Programming Exercises 232
5.10 M
 aking Constructors More Debugging Exercises 233
Efficient by Using Decisions in
Game Zone 234
Other Methods 189
Case Problems 235

Don’t Do It 193


Summary 193 CHAPTER 7
Key Terms 194
CHARACTERS, STRINGS, AND
Review Questions 194
THE StringBuilder 237
Programming Exercises 197
Debugging Exercises 198 7.1 Understanding String Data
Game Zone 199
Problems237
Case Problems 200 7.2 Using Character Class Methods 238

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents vii

7.3 Declaring and Comparing 8.8 Using Two-Dimensional and Other


String Objects 241 Multidimensional Arrays 300
Comparing String Values 241 Passing a Two-Dimensional Array to a Method 302
Empty and null Strings 245 Using the length Field with a Two-Dimensional
Array303
7.4 Using a Variety of String
Methods246 Understanding Jagged Arrays 304
Using Other Multidimensional Arrays 304
Converting String Objects to Numbers 249

7.5 Learning About the StringBuilder 8.9 Using the Arrays Class 307
and StringBuffer Classes 253 8.10 Creating Enumerations 311

Don’t Do It 257 Don’t Do It 316


Summary 258 Summary 317
Key Terms 258 Key Terms 318
Review Questions 258 Review Questions 318
Programming Exercises 260 Programming Exercises 320
Debugging Exercises 262 Debugging Exercises 323
Game Zone 263 Game Zone 323
Case Problems 264 Case Problems 327

CHAPTER 8 CHAPTER 9
ARRAYS267 INHERITANCE AND INTERFACES 329
8.1 Declaring an Array 267 9.1 Learning About the Concept of
8.2 Initializing an Array 271 Inheritance329
Inheritance Terminology 331
8.3 Using Variable Subscripts with an
Array273 9.2 Extending Classes 332
Using the Enhanced for Loop 275 9.3 Overriding Superclass Methods 336
Using Part of an Array 275 Using the @Override Annotation 337
8.4 Declaring and Using Arrays 9.4 Calling Constructors During
of Objects 277 Inheritance339
Using the Enhanced for Loop with Objects 279 Using Superclass Constructors That Require
Manipulating Arrays of Strings 279 Arguments 340

8.5 Searching an Array and Using 9.5 Accessing Superclass Methods 344
Parallel Arrays 284 Comparing this and super 345
Using Parallel Arrays 284
9.6 Employing Information Hiding 346
Searching an Array for a Range Match 286
9.7 Methods You Cannot Override 348
8.6 Passing Arrays to and Returning
Arrays from Methods 289 A Subclass Cannot Override static Methods
in Its Superclass 348
Returning an Array from a Method 291
A Subclass Cannot Override final Methods
8.7 Sorting Array Elements 292 in Its Superclass 350
Using the Bubble Sort Algorithm 293 A Subclass Cannot Override Methods in a final
Improving Bubble Sort Efficiency 295 Superclass 351
Sorting Arrays of Objects 295 9.8 Creating and Using Abstract
Using the Insertion Sort Algorithm 296 Classes352

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii Contents

9.9 Using Dynamic Method Binding 359 10.7 T


 racing Exceptions Through the
Using a Superclass as a Method Parameter Type 360 Call Stack 415
9.10 C
 reating Arrays of Subclass 10.8 C
 reating Your Own Exception
Objects361 Classes419
9.11 U
 sing the Object Class and Its 10.9 Using Assertions 421
Methods364 10.10 Displaying the Virtual Keyboard 430
Using the toString() Method 364
Using the equals() Method 366 Don’t Do It 433
Overloading equals() 367 Summary 434
Overriding equals() 369 Key Terms 434
9.12 Creating and Using Interfaces 371 Review Questions 435
Creating Interfaces to Store Related Constants 374 Programming Exercises 437
Debugging Exercises 439
9.13 U
 sing records, Anonymous Inner
Classes, and Lambda Expressions 377 Game Zone 439

Using records 377 Case Problems 440

Using Anonymous Inner Classes 379


Using Lambda Expressions 380 CHAPTER 11
FILE INPUT AND OUTPUT 441
Don’t Do It 381
Summary 381
11.1 Understanding Computer Files 441
Key Terms 383 11.2 U
 sing the Path and Files
Review Questions 383 Classes443
Programming Exercises 385 Creating a Path 443
Debugging Exercises 389 Retrieving Information About a Path 444
Game Zone 390 Converting a Relative Path to an Absolute One 445
Case Problems 391 Checking File Accessibility 446
Deleting a Path 447
Determining File Attributes 448
CHAPTER 10
11.3 F
 ile Organization, Streams, and
EXCEPTION HANDLING 393 Buffers450
10.1 Learning About Exceptions 393 11.4 Using Java’s IO Classes 452
10.2 T
 rying Code and Catching Writing to a File 454
Exceptions397 Reading from a File 454
Using a try Block to Make Programs “Foolproof” 400 11.5 C
 reating and Using Sequential
Declaring and Initializing Variables in try…catch Data Files 457
Blocks 402
11.6 L
 earning About Random Access
10.3 T
 hrowing and Catching Multiple Files461
Exceptions404
11.7 W
 riting Records to a Random
10.4 Using the finally Block 408 Access Data File 463
10.5 U
 nderstanding the Advantages 11.8 R
 eading Records from a Random
of Exception Handling 410 Access Data File 468
10.6 S
 pecifying the Exceptions That Accessing a Random Access File Sequentially 468
a Method Can Throw 412 Accessing a Random Access File Randomly 470

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents ix

Don’t Do It 479 13.4 Using the LinkedList Class 524


Summary 479
13.5 Using Iterators 528
Key Terms 480
Review Questions 480
13.6 Creating Generic Classes 530
Programming Exercises 482 13.7 Creating Generic Methods 532
Debugging Exercises 484 Creating a Generic Method with More than One
Game Zone 484 Type Parameter 533

Case Problems 485


Don’t Do It 537

CHAPTER 12 Summary 538


Key Terms 538
RECURSION487 Review Questions 539

12.1 Understanding Recursion 487 Programming Exercises 541


Debugging Exercises 542
12.2 U
 sing Recursion to Solve
Game Zone 542
Mathematical Problems 489
Case Problems 543
Computing Sums 490
Computing Factorials 491
12.3 U
 sing Recursion to Manipulate CHAPTER 14
Strings495
INTRODUCTION TO Swing
Using Recursion to Separate a Phrase into Words 495
Using Recursion to Reverse the Characters in a
COMPONENTS545
String 496 14.1 U
 nderstanding Swing
12.4 U
 sing Recursion to Create Visual Components545
Patterns499 14.2 Using the JFrame Class 547
12.5 R
 ecursion’s Relationship to Customizing a JFrame’s Appearance 549
Iterative Programming 500 14.3 Using the JLabel Class 552
Changing a JLabel’s Font 553
Don’t Do It 503
14.4 Using a Layout Manager 555
Summary 503
Key Terms 504 14.5 Extending the JFrame Class 557
Review Questions 504 14.6 A
 dding JTextFields and
Programming Exercises 506 JButtons to a JFrame 559
Debugging Exercises 508 Adding JTextFields to a JFrame 559
Game Zone 509 Adding JButtons to a JFrame 560
Case Problems 510 14.7 L
 earning About Event-Driven
Programming563
CHAPTER 13 Preparing Your Class to Accept Event Messages 564
Telling Your Class to Expect Events to Happen 564
COLLECTIONS AND GENERICS 511 Telling Your Class How to Respond to Events 564
13.1 U
 nderstanding the Collection Writing an Event-Driven Program 565
Interface511 Using Multiple Event Sources 566
13.2 U
 nderstanding the List Using the setEnabled() Method 567
Interface513
14.8 U
 nderstanding Swing Event
13.3 Using the ArrayList Class 514 Listeners569

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
x Contents

14.9 U
 sing the JCheckBox, APPENDIX C
ButtonGroup, and JComboBox
Classes572 FORMATTING OUTPUT  595
The JCheckBox Class 572
The ButtonGroup Class 574 APPENDIX D
The JComboBox Class 575
GENERATING RANDOM
Don’t Do It 580 NUMBERS 603
Summary 581
Key Terms 581 APPENDIX E
Review Questions 582
JAVADOC  607
Programming Exercises 584
Debugging Exercises 585
Game Zone 585
APPENDIX F
Case Problems 586 USING JAVAFX AND SCENE
BUILDER613
APPENDIX A
GLOSSARY 625
WORKING WITH THE INDEX 641
JAVA PLATFORM 587

APPENDIX B
DATA REPRESENTATION 591

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE
Java Programming, Tenth Edition provides the beginning programmer with a guide to developing applications
using the Java programming language. Java is popular among professional programmers because it is object-
oriented, making complex problems easier to solve than in some other languages. Java is used for desktop
computing, mobile computing, game development, Web development, and numerical computing.

This course assumes that you have little or no programming experience. It provides a solid background in
good object-oriented programming techniques and introduces terminology using clear, familiar language. The
programming examples are business examples; they do not assume a mathematical background beyond high
school business math. In addition, the examples illustrate only one or two major points; they do not contain so
many features that you become lost following irrelevant and extraneous details. Complete, working programs
appear frequently in each chapter; these examples help students make the transition from the theoretical
to the practical. The code presented in each chapter also can be downloaded from the Cengage website, so
students easily can run the programs and experiment with changes to them.

The student using Java Programming, Tenth Edition builds applications from the bottom up rather than
starting with existing objects. This facilitates a deeper understanding of the concepts used in object-oriented
programming and engenders appreciation for the existing objects students use as their knowledge of the
language advances. When students complete this course, they will know how to modify and create simple Java
programs, and they will have the tools to create more complex examples. They also will have a fundamental
knowledge of object-oriented programming, which will serve them well in advanced Java courses or in studying
other object-oriented languages such as C++, C#, and Visual Basic.

Organization and Coverage


Java Programming, Tenth Edition presents Java programming concepts, enforcing good style, logical thinking,
and the object-oriented paradigm. Objects are covered right from the beginning, earlier than in many other
Java courses. You create your first Java program in Chapter 1. Chapters 2, 3, and 4 increase your understanding
about how data, classes, objects, and methods interact in an object-oriented environment.

Chapters 5 and 6 explore input and repetition structures, which are the backbone of programming logic and
essential to creating useful programs in any language. You learn the special considerations of string and array
manipulation in Chapters 7 and 8.

Chapters 9 and 10 thoroughly cover inheritance, interfaces, and exception handling. Inheritance is the object-
oriented concept that allows you to develop new objects quickly by adapting the features of existing objects,
interfaces define common methods that must be implemented in all classes that use them, and exception
handling is the object-oriented approach to handling errors. All of these are important concepts in object-
oriented design. Chapter 11 provides information about handling files so you can store and retrieve program
output.

Chapter 12 explains recursion, and Chapter 13 covers Java collections and generics. Both are important
programming concepts, and Java provides excellent ways to implement and learn about them. Chapter 14
introduces GUI Swing components, which are used to create visually pleasing, user-friendly, interactive
applications.

xi

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xii Preface

New in This Edition


The following features are new for the Tenth Edition:

❯❯Java: All programs have been tested using Java 16.

❯❯Java help: Instructions on searching for Java help have been updated to avoid using specific URLs because new
Java versions are now being released twice a year.
❯❯Text blocks: Chapter 2 introduces text blocks—a new feature since Java 13.

❯❯Methods: Methods are covered thoroughly in Chapter 3, including topics such as overloading methods and
avoiding ambiguity. In previous editions, the material was split between chapters.
❯❯Classes and objects: Classes and objects are covered thoroughly in Chapter 4. In previous editions, the material
was split between chapters.
❯❯The switch expression: Chapter 5 includes the switch expression, which became a new feature in Java 14.

❯❯Arrays: Chapter 8 covers beginning and advanced array concepts. In previous editions, this content was split
between chapters.
❯❯Inheritance and interfaces: Chapter 9 covers inheritance and interfaces. In previous editions, this content was
split between chapters.
❯❯The record keyword: Chapter 9 also introduces the record keyword, which allows simple classes to be
developed more quickly because a constructor and methods to get and set fields are created automatically
based on field definitions.
❯❯Recursion: Chapter 12 is a new chapter on recursion. The chapter presents techniques to use to solve
mathematical problems, manipulate strings, and create visual patterns using recursion.
❯❯Collections and generics: Chapter 13 is a new chapter on collections and generics. The chapter covers the
Collection and List interfaces, the ArrayList and LinkedList classes, Iterators, and generic
classes and methods.

Additionally, Java Programming, Tenth Edition includes the following features:

❯❯Objectives: Each chapter begins with a list of objectives so you know the topics that will be presented in the
chapter. In addition to providing a quick reference to topics covered, this feature provides a useful study aid.
❯❯You Do It: In each chapter, step-by-step exercises help students create multiple working programs that
emphasize the logic a programmer uses in choosing statements to include. These sections provide a means for
students to achieve success on their own—even those in online or distance learning classes.
❯❯Notes: These highlighted tips provide additional information—for example, an alternative method of performing
a procedure, another term for a concept, background information about a technique, or a common error to
avoid.
❯❯Emphasis on student research: The student frequently is advised to use the Web to investigate Java classes,
methods, and techniques. Computer languages evolve, and programming professionals must understand how to
find the latest language improvements.
❯❯Figures: Each chapter contains many figures. Code figures are most frequently 25 lines or fewer, illustrating one
concept at a time. Frequent screenshots show exactly how program output appears. Callouts appear where
needed to emphasize a point.
❯❯Color: The code figures in each chapter contain all Java keywords in blue. This helps students identify keywords
more easily, distinguishing them from programmer-selected names.
❯❯Files: More than 200 student files can be downloaded from the Cengage website. Most files contain the code
presented in the figures in each chapter; students can run the code for themselves, view the output, and make

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xiii

changes to the code to observe the effects. Other files include debugging exercises that help students improve
their programming skills.
❯❯Two Truths & a Lie: A short quiz reviews almost every chapter section, with answers provided. This quiz
contains three statements based on the preceding section of text—two statements are true, and one is false.
Over the years, students have requested answers to problems, but we have hesitated to distribute them in case
instructors want to use problems as assignments or test questions. These true-false quizzes provide students
with immediate feedback as they read, without “giving away” answers to the multiple-choice questions and
programming exercises.
❯❯Don’t Do It: This section at the end of each chapter summarizes common mistakes and pitfalls that plague new
programmers while learning the current topic.
❯❯Summary: Following each chapter is a summary that recaps the programming concepts and techniques covered
in the chapter. This feature provides a concise means for students to check their understanding of the main
points in each chapter.
❯❯Key Terms: Each chapter includes a list of newly introduced vocabulary, shown in alphabetical order. The list of
key terms provides a short review of the major concepts in the chapter.
❯❯Review Questions: Each chapter includes 20 multiple-choice questions that serve as a review of chapter topics.

❯❯Programming Exercises: Multiple programming exercises are included with each chapter. These challenge
students to create complete Java programs that solve real-world problems.
❯❯Debugging Exercises: Four debugging exercises are included with each chapter. These are programs that
contain logic or syntax errors that the student must correct. Besides providing practice in deciphering error
messages and thinking about correct logic, these exercises provide examples of complete and useful Java
programs after the errors are repaired.
❯❯Game Zone: Each chapter provides one or more exercises in which students can create interactive games
using the programming techniques learned up to that point; 50 game programs are suggested in the course.
The games are fun to create and play; writing them motivates students to master the necessary programming
techniques. Students might exchange completed game programs with each other, suggesting improvements and
discovering alternate ways to accomplish tasks.
❯❯Cases: Each chapter contains two running case problems. These cases represent projects that continue to
grow throughout a semester using concepts learned in each new chapter. Two cases allow instructors to assign
different cases in alternate semesters or to divide students in a class into two case teams.
❯❯Glossary: A glossary contains definitions for all key terms in the course.

❯❯Appendices: This edition includes useful appendices on working with the Java platform, data representation,
formatting output, generating random numbers, creating Javadoc comments, and JavaFX.
❯❯Quality: Every program example, exercise, and game solution was tested by the author and then tested again by
a quality assurance team.

MindTap Instructor Resources


MindTap activities for Java Programming, Tenth Edition are designed to help students master the skills they need in
today’s workforce. Research shows employers need critical thinkers, troubleshooters, and creative problem-solvers
to stay relevant in our fast-paced, technology-driven world. MindTap helps you achieve this with assignments and
activities that provide hands-on practice and real-life relevance. Students are guided through assignments that help
them master basic knowledge and understanding before moving on to more challenging problems.

All MindTap activities and assignments are tied to defined unit learning objectives. MindTap provides the analytics and
reporting so you can easily see where the class stands in terms of progress, engagement, and completion rates. Use

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xiv Preface

the content and learning path as is or pick and choose how our materials will wrap around yours. You control what
the students see and when they see it. Learn more at http://www.cengage.com/mindtap/.

In addition to the readings, the Java Programming, Tenth Edition MindTap includes the following:

❯❯Gradeable assessments and activities: All assessments and activities from the readings will be available as
gradeable assignments within MindTap, including Review Questions, Game Zone, Case Problems, and Two
Truths & a Lie.
❯❯Videos: Each unit is accompanied by videos that help to explain important unit concepts and provide demos on
how students can apply those concepts.
❯❯Coding Snippets: These short, ungraded coding activities are embedded in the MindTap Reader and provide
students an opportunity to practice new programming concepts “in the moment.” The coding Snippets help
transition the students from conceptual understanding to application of Java code.
❯❯Coding labs: These assignments provide real-world application and encourage students to practice new coding
skills in a complete online IDE. Guided feedback provides personalized and immediate feedback to students as
they proceed through their coding assignments so that they can understand and correct errors in their code.
❯❯Interactive study aids: Flashcards and PowerPoint lectures help users review main concepts from the units.

Instructor and Student Resources


Additional instructor and student resources for this product are available online. Instructor assets include an
Instructor’s Manual, Educator’s Guide, PowerPoint® slides, Solution and Answer Guide, solutions, and a test bank
powered by Cognero®. Student assets include data files. Sign up or sign in at www.cengage.com to search for and access
this product and its online resources.

❯❯Instructor’s Manual: The Instructor’s Manual includes additional instructional material to assist in class
preparation, including sections such as Chapter Objectives, Complete List of Chapter Activities and
Assessments, Key Terms, What’s New In This Chapter, Chapter Outline, Discussion Questions, Suggested Usage
for Lab Activities, Additional Activities and Assignments, and Additional Resources. A sample syllabus also is
available.
❯❯PowerPoint presentations: The PowerPoint slides can be used to guide classroom presentations, to make
available to students for chapter review, or to print as classroom handouts.
❯❯Solution and Answer Guide: Solutions to all end-of-chapter assignments are provided along with feedback.

❯❯Solutions: Solutions to all programming exercises are available. If an input file is needed to run a programming
exercise, it is included with the solution file.
❯❯Test bank: Cengage Testing Powered by Cognero is a flexible, online system that allows you to:
■■ Author, edit, and manage test bank content from multiple Cengage solutions.
■■ Create multiple test versions in an instant.
■■ Deliver tests from your LMS, your classroom, or wherever you want.
❯❯Educator’s Guide: The Educator’s Guide contains a detailed outline of the corresponding MindTap course.

❯❯Transition Guide: The Transition Guide outlines information on what has changed from the Ninth Edition.

❯❯Data files: Data files necessary to complete some of the steps and projects in the course are available. The Data
Files folder includes Java files that are provided for every program that appears in a figure in the text.

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xv

About the Author


Joyce Farrell has taught computer programming at McHenry County College, Crystal Lake, Illinois; the University of
Wisconsin, Stevens Point, Wisconsin; and Harper College, Palatine, Illinois. Besides Java, she has written books on
programming logic and design, C#, and C++ for Cengage.

Acknowledgments
I would like to thank all of the people who helped to make this project a reality, including Tran Pham, Associate Product
Manager; Mary Convertino, Learning Designer; Maria Garguilo, Senior Content Manager; Dan Seiter, Developmental
Editor, and John Freitas, Quality Assurance Tester. I am lucky to work with these professionals who are dedicated to
producing high-quality instructional materials.

I am also grateful to the reviewers who provided comments and encouragement during this course’s development,
including Dr. Ross Foultz, Coastal Carolina University; and Dr. Carl M. Rebman, Jr., University of San Diego. Also, thank
you to Charles W. Lively III, Ph.D. – Academic Faculty, Georgia Institute of Technology, who provided the appendix on
JavaFX.

Thanks, too, to my husband, Geoff, for his constant support, advice, and encouragement. Finally, this project is
dedicated to Norman Williams Peterson, who has brought a smile to my face every time I have seen him.

Joyce Farrell

Read This Before You Begin


The following information will help you as you prepare to complete this course.

To the User of the Data Files


To complete the steps and projects in this course, you need data files that have been created specifically for some of
the exercises. Your instructor will provide the data files to you. You also can obtain the files electronically by signing
up or signing in at www.cengage.com and then searching for and accessing this product and its online resources. Note
that you can use a computer in your school lab or your own computer to complete the exercises.

Using Your Own Computer


To use your own computer to complete the steps and exercises, you need the following:

❯❯Software: Java SE 16 or later, available from www.oracle.com/technetwork/java/index.html. Although almost


all of the examples in this course will work with earlier versions of Java, a few require Java 16 or later. You also
need a text editor, such as Notepad. A few exercises ask you to use a browser for research.
❯❯Hardware: For operating system requirements (memory and disk space), see http://java.com/en/download/
help.

Copyright 2023 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Another Random Scribd Document
with Unrelated Content
The text on this page is estimated to be only 28.84%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 49] was obliged to


take corresponding measures. The Russian mobilisation is confirmed
by the commanders of our Galician forces, and, according to a
communication from the Imperial and Royal Military Attache, in a
conversation which M. Sazonof had to-day with the German
Ambassador it was no longer denied. I request your Excellency to
bring the above without delay to the knowledge of the German
Government, and at the same time to emphasise that if the Russian
measures of mobilisation are not stopped without delay, our general
mobilisation would have, on military grounds, to follow at once.(1)
As a last effort to maintain the peace of Europe, I con- 47-1 sidered
it desirable that our representative and the representative of
Germany at St. Petersburg, and, if necessary, at Paris, should at
once be instructed to declare to the Governments to whom they are
accredited in a friendly manner, that the continuance of the Russian
mobilisation would have as a result counter-measures in Germany
and Austria-Hungary, which must lead to serious consequences. Your
Excellency will add that, as can be understood, in our military
operations against Serbia we will not allow ourselves to be diverted
from our path. The Imperial and Royal Ambassadors at St.
Petersburg and Paris are receiving identical instructions to make the
above declaration as soon as their German colleague receives similar
instructions. No. 49. Count Berchtold to Count Szdpdry at St.
Petersburg. (Telegraphic.) Vienna, July 30, 1914. IN answer to your
Excellency's telegram of the 29th July.(2) (2)[No 47I am of course
still ready to explain to M. Sazonof, through your Excellency, the
various points contained in our note addressed to Serbia which
however has already been outstripped by recent events. I should
also attach special importance, in accordance with the suggestion
made to me through M. Schebeko, also to discussing on this
occasion in a confidential and friendly manner the questions which
27?
The text on this page is estimated to be only 26.88%
accurate

R. 50] AUSTRO-HUNGARIAN RED-BOOK [JULY (1)[c/. Nos.


affect directly our relations towards Russia. (1> From this 50, 56 ; it
might be hoped that it would be possible to remove the Q ™-i '
ambiguities which have arisen and to secure the development in a
friendly manner of our relations towards our neighbours, which is so
desirable an object. No. 50. Count Berchtold to Count Szdpdry at St.
Petersburg. (Telegraphic.) Vienna, July 30, 1914. FOR Your
Excellency's information and guidance :— orcf Q I have to-day
explained to M. Schebeko (a> that I have 66.] been informed that
M. Sazonof has been hurt by my flat (3)rNo 40] rerusal<3) °f his
proposal as to a discussion with your Excellency, and that he is not
less hurt that no exchange of ideas has taken place between myself
and M. Schebeko. With reference to the first point, I had already
permitted <4>rNo 4Qi your Excellency by telegram (4) to give M.
Sazonof any explantions he desired with regard to the note — which
in any case appears to be outstripped by the outbreak of war. In any
case this could only take the form of subsequent explanations, as it
was never our intention to depart in any way from the points
contained in the note. I had also authorised your Excellency to
discuss in a friendly manner with M. Sazonof our special relations
towards Russia. That M. Sazonof should complain that no exchange
of ideas had taken place between M. Schebeko and myself must [cf
No. rest on a misunderstanding, (5) as M. Schebeko and myself 56*;
B. "had discussed the practical questions two days before, (e) a
137-] fact which the Ambassador confirmed with the observation
'•6}[See No. that he had fully informed M. Sazonof of this
conversation. M. Schebeko then explained why our action against
Serbia was regarded with such anxiety at St. Petersburg. He said
that we were a Great Power which was proceeding against the small
Serbian State, and it was not known at St. Petersburg what our
intentions in the matter were ; whether we desired to encroach on
its sovereignty, whether we desired completely to overthrow it, or
even to crush it to the ground. 280 (5)
The text on this page is estimated to be only 29.35%
accurate

AUSTRO-HUNGARIAN RED-BOOK Russia could not be


indifferent towards the future fate oi Serbia/1* which was linked to
Russia by historical and other bonds. At St. Petersburg they had
taken the trouble to use all their influence at Belgrade to induce
them to accept all our conditions, though this was indeed at a time
when the conditions afterwards imposed by us could not yet be
known. But even with reference to these demands they would do
everything they could in order to accomplish at any rate all that was
possible. I reminded the Ambassador that we had repeatedly
emphasised the fact that we did not desire to follow any policy of
conquest in Serbia, also that we would not infringe her sovereignty,
but we only desired to establish a condition of affairs which would
offer us a guarantee against being disturbed by Serbia. To this I
added a somewhat lengthy discussion of our intolerable relations
with Serbia. I also gave M. Schebeko clearly to understand to how
large an extent Russian diplomacy was responsible for these
circumstances, even though this result might be contrary to the
wishes of the responsible authorities. In the further course of our
discussion I referred to the Russian mobilisation which had then
come to my knowledge. Since this was limited to the military districts
of Odessa, Kieff, Moscow and Kasan it had an appearance of hostility
against the Monarchy. I did not know what the grounds for this
might be, as there was no dispute between us and Russia. Austria-
Hungary had mobilised exclusively against Serbia ; against Russia
not a single man ; and this would be observed from the single fact
that the first, tenth and eleventh corps had not been mobilised. In
view, however, of the fact that Russia was openly mobilising against
us, we should have to extend our mobilisation too, and in this case I
desired to mention expressly that this measure did not, of course,
imply any attitude of hostility towards Russia, and that it was
exclusively a necessary counter-measure against the Russian
mobilisation. I asked M. Schebeko to announce this to his
Government, .and this he promised to do. 281
The text on this page is estimated to be only 27.92%
accurate

[R. 513 AUSTRO-HUNGARIAN RED-BOOK [JULY 31 No. 51.


Count Berchtold to the Imperial and Royal Ambassadors at London
and St. Petersburg. (Telegraphic.) Vienna, July 31, 1914. I AM
telegraphing as follows to Berlin : — Herr von Tschirschky has in
accordance with his instructions yesterday communicated a
discussion between Sir E. (1)[c/. B. Grey and Prince Lichnowsky(1)
in which the British Secretary * 103.] of State made the following
announcement to the German Ambassador : — Sazonof has
informed the British Government that after the declaration of war by
Austria-Hungary against Serbia, he is no longer in a position to deal
directly with AustriaHungary, and he therefore requests that Great
Britain will again take up her work of mediation. The Russian
Government regarded the preliminary stoppage of hostilities as a
condition precedent to this. To this Russian declaration, Sir E. Grey
remarked to {2)[c/ B. Prince Lichnowsky(2) that Great Britain
thought of a media84-J tion a quatre, and that she regarded this as
urgently necessary if a general war was to be prevented. I ask your
Excellency to convey our warm thanks to the Secretary of State for
the communications made to us through Herr von Tschirschky, and
to declare to him that in spite of the change in the situation which
has since arisen through the mobilisation of Russia, we are quite
prepared to entertain the proposal of Sir E. Grey to negotiate
between us and Serbia. The conditions of our acceptance are,
nevertheless, that our military action against Serbia should continue
to take its course, and that the British Cabinet should move the
Russian Government to bring to a standstill the Russian mobilisation
which is directed against us, in which case, of course, we will also at
once cancel the defensive military counter-measures in Galicia,
which are occasioned by the Russian attitude. 282
The text on this page is estimated to be only 26.13%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 54J No. 52. Count


Szapdry to Count Berchtold. (Telegraphic.) St. Petersburg, July 31,
1914. THE order for the general mobilisation of the entire Army and
Fleet was issued early to-day. (1) (1)[c/. B. 113; Y. N°- 53- S/4J
Count Berchtold to the Imperial and Royal Diplomatic
Representatives. (Telegraphic.) Vienna, July 31, 1914. FOR your
information and for use in your dealings with the Government to
which you are accredited. As mobilisation has been ordered by the
Russian Government on our frontier, we find ourselves obliged to
take military measures in Galicia. These measures are purely of a
defensive character and arise exclusively under the pressure of the
Russian measures, which we regret exceedingly, as we ourselves
have no aggressive intentions of any kind against Russia, and desire
the continuation of the former neighbourly relations. Pourparlers
between the Cabinets at Vienna and St. Petersburg appropriate to
the situation are meanwhile being continued, w and from these we
hope that things will quieten <2> [cf. B, down all round. no ; O. No.
54- 66'] Count Szecsen to Count Berchtold. (Telegraphic.) Paris, July
31, 1914. GERMAN Ambassador in pursuance of the instructions of
his Government has declared here that if the general mobilisation
ordered by the Russian Government is . not stopped within 12 hours,
Germany also will mobilise. (3) At (3)[c/. O. the same time Baron
Schoen has asked whether France will 7° and remain neutral in the
event of a war between Germany and no*e ' wRussia. (4) An answer
to this is requested within eighteen (4)f* ' ^ hours. The time-limit
expires to-morrow (Saturday) at ™ I25 i i o'clock in the afternoon.
283
The text on this page is estimated to be only 26.90%
accurate

[R. 55] AUSTRO-HUNGARIAN RED-BOOK [JULY 3 No. 55.


Count S zap dry to Count Berchtold. (Telegraphic.) St. Petersburg,
July 31, 1914. ^[Nos. 49, YOUR Excellency's telegram of the 30th
July(1) has been 50.3 received. You will have gathered from my
telegram of the 2Qth <2)[No. 47.] July,(2) that without waiting for
instructions I again resumed <3)[c/. B. conversations with M.
SazonoP1 more or less on the basis iio ; O. wnich has now been
indicated to me, but that the points of view on the two sides had not
materially approximated to each other. Meanwhile, however, it has
appeared from the conversations between the German Ambassador
and the Russian Minister for Foreign Affairs that Russia will not
accept as satisfactory the formal declaration that Austria-Hungary
will neither diminish the territory of the Serbian Kingdom nor infringe
on Serbian sovereignty, nor injure Russian interests in the Balkans or
elsewhere ; since then moreover <4) [No. 52.] a general
mobilisation has been ordered on the part of Russia. (4) No. 56.
Count Szdpdry to Count Berchtold. (Telegraphic.) St. Petersburg,
August i, 1914. I VISITED M. Sazonof to-day, and told him that I had
received instructions, but that I must premise that I was entirely
ignorant of the present condition of affairs created in Vienna by the
general Russian mobilisation, and that in interpreting the instructions
which I had received previously, I must leave this condition out of
account. I said that the <6>[Nos. 49, two instructions of Your
Excellency (5) dealt with the mis5°J understanding that we had
declined further negotiations with Russia. This was a mistake, as I
had already, without instructions, assured him. Your Excellency was
not only quite <6)[c/. B. prepared to deal with Russia on the
broadest basis possible, 137, 161 ; but was also especially inclined to
subject the text of our note Y. 120.3 to a discussion so far as its
interpretation was concerned. (6) 284
The text on this page is estimated to be only 27.05%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 58J I emphasised


how much the instructions of Your Excellency afforded me a further
proof of goodwill, although I had to remind him that the situation
created since then by the general mobilisation was unknown to me ;
but I could only hope that the course of events had not already
taken us too far ; in any case, I regarded it as my duty in the
present moment of extreme anxiety to prove once again the
goodwill of the Imperial and Royal Government. M. Sazonof replied
that he took note with satisfaction of this proof of goodwill, but he
desired to draw my attention to the fact that negotiations at St.
Petersburg for obvious reasons appeared to promise less prospect of
success than negotiations on the neutral terrain of London. (1) I
replied that Your Excellency, as I (1)[c/. ¥.98 had already observed,
started from the point of view that and note.] direct contact should
be maintained at St. Petersburg, so that I was not in a position to
commit myself with regard to his suggestion as to London, but I
would communicate on the subject with your Excellency. No. 57.
Count Szogyeny to Count Berchtold. (Telegraphic.) Berlin, August 2,
1914. THE Secretary of State has just informed me that no answer
has been received from Russia to the German demand.01* w[cf. No.
The Russian troops have crossed the German frontier at 54; O.
Schwidden (south-east of Bialla). 7°'] Russia has thus attacked
Germany. (3) (3)[c/. W. Germany, therefore, regards herself as at
war with P- I35-l Russia. (4) <4>[DeclarThe Russian Ambassador
has this morning received his ation of passports ; he intends to leave
to-day. w*' No. 58. Count Mensdorff to Count Berchtold.
(Telegraphic.) London, August 4, 1914. I HAVE just seen Sir E. Grey.
The British Government have sent to Germany an ultimatum on
account of Belgium. (5) (5)[B. 159.] They expect a reply at 12
o'clock to-night. 285
The text on this page is estimated to be only 27.37%
accurate

[R. 59] AUSTRO-HUNGARIAN RED-BOOK [AUGUST Sir E.


Grey said to me that at present there was no reason why he should
make any communication to the Imperial and Royal Government,
and there was no cause why a conflict should arise between us, so
long as we were not in a condition of war with France. In any case,
he hoped that we would not begin hostilities without the formality of
a previous (1) [Reply, declaration of war.(1) He does not intend to
recall Sir M. de No. 60.] Bunsen. Should we be at war with France, it
would indeed be difficult for Great Britain, as the ally of France, to
co-operate with her in the Atlantic, and not in the Mediterranean.
No. 59. Count Berchtold to Count Szdpdry at St. Petersburg.
(Translated from the French.) (Telegraphic.) Vienna, August 5, 1914.
(2)[Pre- I ASK Your Excellency to hand over the following note(2>
sented ^o ^he Minister for Foreign Affairs : — Aug. 6 — 5^0.79.] "
On the instructions of his Government, the undersigned, the Austro-
Hungarian Ambassador, has the honour to inform His Excellency the
Russian Minister for Foreign Affairs as follows : — " In view of the
threatening attitude adopted by Russia in the conflict between the
Austro-Hungarian Monarchy and Serbia ; and of the fact that,
according to a communication from the Berlin Cabinet, Russia has
seen fit, as a result of that conflict, to open hostilities against
Germany ; and whereas Germany is consequently at war with Russia
; AustriaHungary therefore considers herself also at war with Russia
from the present moment." After handing over this note Your
Excellency will ask that passports may be prepared, and you will
leave without delay with the entire staff of the Embassy with the
exception of any members who are to be left behind. At the same
time M. Schebeko is being furnished with his passport by us. 286
The text on this page is estimated to be only 27.08%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 62] No. 60. Count


Berchtold to Count Mensdorff at London. (Telegraphic.) Vienna,
August 6, 1914. I HAVE received Your Excellency's telegram of the
4th August. (1) (1)[No. 58.] I ask you to assure Sir E. Grey that we
will in no case open hostilities against Great Britain without a
previous formal declaration of war, but that we also expect that
Great Britain will observe towards us a similar attitude, and that she
will not undertake any hostile act against us before formally
declaring war. No. 61. Count Szecsen to Count Berchtold.™ (2)
[Reply, (Translated from the French.} Na 62>1 (Telegraphic.) Paris,
August 8, 1914. THE Minister for Foreign Affairs asked me to go and
see him in order to communicate to me that, according to positive
information which has reached him, the Innsbruck Army Corps has
been brought to the French frontier. M. Doumergue wishes to know
without delay if this information is correct, and if it is so, what is the
intention of the Imperial and Royal Government. As France is at war
with Germany the despatch of our troops to the French frontier is,
according to the views held by the Minister, not consistent with the
existing condition of peace between Austria-Hungary and France. M.
Dumaine is commissioned to make a similar communication to Your
Excellency. No. 62. Count Berchtold to Count Szecsen at Paris. w (3)
[Reply, No. 63.] (Telegraphic.) Vienna, August 9, 1914. WITH
reference to Your Excellency's telegram of the 8th instant. (4) (4)
[No.6i.J 287
The text on this page is estimated to be only 28.15%
accurate

[R. 63] AUSTRO-HUNGARIAN RED-BOOK [AUGUST : After


conferring with the General Staff I authorise Your Excellency to
inform the French Government that the information regarding the
participation of our troops in the (1)[c/. No. Franco-German war is a
complete invention. (1) I have 64-3 expressed myself in a similar
manner to M. Dumaine. No. 63. Count Szecsen to Count Berchtold.
(Translated from the French.) (Telegraphic.) Paris, August 10, 1914.
(2)|No. 62.3 I HAVE received your telegram of the gth August (2)
and communicated at once the contents to M. Doumergue. The
Minister, who had received a similar telegraphic report from M.
Dumaine concerning his conversation with Your Excellency, admitted
that our troops are not on the French frontier, but he maintains that
he has positive information that an Austro-Hungarian army corps has
been brought to Germany, and that this makes it possible for that
Empire to withdraw her troops from those districts which are
occupied by our soldiers, and that in the opinion of the Minister this
amounts to a facilitation of German military operations. I repeatedly
drew the attention of the Minister to the wording of the answer of
Your Excellency, and he has admitted that it is not possible to speak
of an effective participation of our troops in the Franco-German war,
but he insisted that it is undeniable that our troops are present on
German territory, and that this is equivalent to the provision of
military assistance to (8) [See No. Germany. (3) In these
circumstances he has authorised the 64-l French Ambassador at
Vienna to ask for his passports without delay, and to leave Vienna
to-day with the entire staff of the Embassy. The Minister informed
me that in view of this position, my presence here can be of no use ;
indeed in view of the excitement of the populace it might give
occasion to regrettable occurrences which he desired to avoid. He
offered to place a train at my disposal from to-night onwards in
order that I might leave France. I answered that it was impossible
for me to receive instructions from Your Excel(4)[c/. No. lency before
the evening, but that in view of the recall of 64.] M. Dumaine, I
asked him to have my passport prepared. (4> 288
The text on this page is estimated to be only 27.17%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 65] No. 64. Count


Berchtold to Count Mensdorff at London. Vienna, August n, 1914.
THE French Government have commissioned theirf Ambassador here
to ask for his passports'1' on the ground that an (1)[c/. No. Austro-
Hungarian army corps has been sent to Germany, 63.] whereby it
has been possible for the German army staff to withdraw their
troops from those German districts which are occupied by our
contingents. This measure of our general staff indicates in his view
the grant of military assistance to Germany. Your Excellency should
bring to the knowledge of the British Government that according to
information obtained from a reliable source the assertion made by
the French Government is unfounded.021 (2)[c/. No. 62.J No. 65.
Count Mensdorff to Count Berchtold. (Translated from the French.)
(Telegraphic.) London, August 12, 1914. I HAVE just received from
Sir E. Grey the following communication : — At the request of the
French Government, who are not in a position to communicate direct
with your Government, I have to make to you the following
communication : — The Austro-Hungarian Government, after
declaring war on Serbia, and thus taking the first initiative to the
hostilities in Europe, have, without any provocation on the part of.
the Government of the French Republic, extended the war to France
: — (i) After Germany had in succession declared war on Russia and
France, the Austro-Hungarian Government have joined in the conflict
by declaring war against Russia, which was already fighting on the
side of France. II— T 289
The text on this page is estimated to be only 27.85%
accurate

[R. 66] AUSTRO-HUNGARIAN RED-BOOK [AUGUST 2 (2)


According to information from numerous trustworthy sources Austria
has sent troops to the German frontier under circumstances which
amounted to a direct menace to France. In view of these facts the
French Government are obliged to inform the Austro-Hungarian
Government that they will take all measures which make it possible
for them to answer these actions and these threats. Sir E. Grey adds
: — As a breach with France has been brought about in this way the
British Government feel themselves obliged to announce that Great
Britain and Austria-Hungary will be in w[cf. B. a state of war as from
12 o'clock to-night. (1) 161.3 No. 66. The Japanese Ambassador to
Count Berchtold. (Translated from the English.) MY LORD, Vienna,
August 20, 1914. YOUR Excellency will doubtless have already
received information from his Excellency Baron Miiller of the
communication which was addressed to the German Government (2)
[c/. Nos. by my Government on the I5th inst.(2) Nevertheless I take
68, 69. the liberty, although I have not received any instructions F°r
to do so, to enclose herewith for your Excellency's personal
Japanese information, a copy of a telegram bearing on the matter
which ultima- I have received from Tokio. turn as given in D-aw-
Enclosure, see p. The Japanese Government, who have taken the
present situation into their earnest consideration, have, in
accordance with a complete understanding made with the British
Government, for the purpose of strengthening and maintaining
general peace in the regions of Eastern Asia, which is one of the
aims of the Anglo-Japanese Alliance, decided to 290
The text on this page is estimated to be only 28.87%
accurate

AUSTRO-HUNGARIAN RED-BOOK take common action with


Great Britain in giving effect to the necessary measures for this
purpose. Nevertheless, before proceeding with measures of this
kind, the Japanese Government have thought it proper to address a
friendly request to the German Government, which was
communicated to them on the I5th August, 1914, in the following
words : — " (i) All German warships must be withdrawn at once
from the waters in the neighbourhood of Japan and China. The ships
that cannot be withdrawn must be disarmed. (2) The German
Government must unconditionally and without compensation hand
over to the Japanese authorities the whole of the leased territory of
Kiao-chau before the i6th September, 1914, for the purpose of
handing this territory back to China. The Japanese Government have
informed the German Government that, in case an answer intimating
unconditional compliance with the above-mentioned demands is not
received before Sunday, the 23rd, at mid-day, they will proceed as
appears necessary to them. It is earnestly to be hoped that the
above-mentioned demands, for a reply to which so ample time is
given, will be agreed to by the German Government ; should they,
however, not comply with this demand, a course of action which
would be deplored, the Japanese Government will be obliged to take
the necessary measures to attain their end." The grounds on which
the Imperial Government base their present attitude is, as already
mentioned, none other than to maintain the common interests of
Japan and Great Britain, which are set out in the Anglo- Japanese
Alliance, by establishing a basis of a lasting peace in the territory of
Eastern Asia. The Japanese Government have in no respect the
intention of embarking upon a policy of territorial expansion, nor do
they entertain any other selfish designs. For this reason the Imperial
Japanese Government are resolved to respect with the greatest care
the interests of third Powers in Eastern Asia and to refrain from,
injuring them in any degree. 291
The text on this page is estimated to be only 27.19%
accurate

. 67] AUSTRO-HUNGARIAN RED-BOOK [AUGUST 2; No. 67.


Count Berchtold to Count Clary at Brussels. (Translated from the
French.} (Telegraphic.) Vienna, August 22, 1914. I ASK your
Excellency to communicate the following [C/.G.77. to the Royal
Belgian Minister for Foreign Affairs at once : — (1> Reply, « j have
the honour to bring the following to the know' ? -J ledge of your
Excellency in accordance with the instructions of our Government :
— Whereas Belgium, having refused to accept the proposals made
to her on several occasions by Germany, is affording her military
assistance to France and Great Britain, both of which Powers have
declared war upon Austria-Hungary, and whereas as has just been
proved, Austrian and Hungarian nationals in Belgium have had to
submit, under the very eyes of the Belgian authorities, to treatment
contrary to the most ) [Denied, primitive demands of humanity/2'
and inadmissible even G. 78.] towards subjects of an enemy State,
therefore Austria-Hungary finds herself obliged to break off
diplomatic relations, and considers herself, from this moment, in a
state of war with Belgium. I am leaving the country with the staff of
the Legation, and I am entrusting the protection of my countrymen
to the Minister of the United States in Belgium. Count Errembault de
Dudzeele has received his passports from the Imperial and Royal
Government. No. 68. Prince Hohenlohe to Count Berchtold.
(Telegraphic.) Berlin, August 23, 1914. THE Foreign Office has
informed the Japanese Charge d' Affaires that the Imperial German
Government do not <3) [See No. intend to send an answer to the
Japanese ultimatum. (3) The 66.3 German Government have
instructed their Ambassador at Tokio, after the expiration of the time
allowed by Japan, at 292
The text on this page is estimated to be only 26.92%
accurate

AUSTRO-HUNGARIAN RED-BOOK [R. 69] 12 o'clock to-day,


to leave Japan, and they will, at the same time, furnish the Japanese
Charge d' Affaires here with his passports. At mid-day the Charge d'
Affaires was furnished with his passports, and he will leave Berlin
early to-morrow morning with the staff of the Embassy. No. 69.
Count Berchtold to Freiherr von Mutter at Tokio. (Telegraphic.)
Vienna, August 24, 1914. THE Commander of S.M.S. "Elisabeth" has
been instructed to take part in the fighting at Tsingtau.(1) I ask (1)
[c/. Nos. your Excellency, in view of the action taken by Japan
against 66> 67 ; our Ally, the German Empire, to ask for your
passports. OQI 302] You should inform the Consulates, and you
should travel to America with the colony and the staff of the
Embassy and of the Consulates. Your Excellency should entrust the
protection of our countrymen and their interests to the American
Ambassador. The Japanese Ambassador here is being furnished with
his passports. 293
The text on this page is estimated to be only 27.46%
accurate

GERMANY AND JAPAN Japanese Foreign Office


Statement.™ Tokio, August 5. THE Imperial Government entertains
the deepest anxiety regarding the political and economic situation
arising from the latest developments of European politics. It hopes
that peace will be quickly restored and that the war will not extend
and that Japan will be able to maintain an attitude of strict
neutrality. It is necessary, however, that the closest attention be paid
to future developments. In the event of Great Britain becoming
involved, the terms of the Japanese Alliance (2) will be affected and
Japan will take the necessary measures to discharge her obligations
under the treaty. The Imperial Government, however, sincerely trusts
that this contingency may never arise. (Renter.) Telegram from the
German Secretary of Foreign Affairs, Berlin, to the German
Ambassador in Tokio, August 12, 1914. EAST Asiatic Squadron
instructed to avoid hostile acts against England in case Japan
remains neutral. Please inform Japanese Government. No answer to
this has been received from Japan. (D.O.W.) Ultimatum^ presented
to the German Government by the Japanese (1)[c/. fuller statement
quoted by Baron Kato, ' p. 298.] P- 504-] Charge d' Affaires, Baron
Funakoshi, on August 17, (4) 1914. in CONSIDERING it highly
important and necessary the present situation to take measures to
remove all causes of disturbance to the peace of the Far East, and to
safeguard the general interest contemplated by the Agreement of
Alliance between Japan and Great Britain in order to secure <3>[For
declaration accompanying the ultimatum, see R.66.J <4>[" Handed
over to the German Government on the i5th August." — Baron Kato,
see P-300;c/. R. 66.] 295
The text on this page is estimated to be only 28.40%
accurate

GERMANY AND JAPAN [AUGUST i a firm and enduring


peace in Eastern Asia, establishment of which is the aim of the said
Agreement, the Imperial Japanese Government sincerely believe it
their duty to give advice to the Imperial German Government to
carry out the following two propositions : — (1) To withdraw
immediately from the Japanese and Chinese waters German men-of-
war and armed vessels of all kinds, and to disarm at once those
which cannot be so withdrawn. (2) To deliver on a date not later
than September I5th, 1914, to the Imperial Japanese authorities,
without condition or compensation, the entire leased territory of
Kiao-chau, with a view to eventual restoration of the same to China.
The Imperial Japanese Government announce at the same time that
in the event of their not receiving by noon August 23rd, 1914, the
answer of the Imperial German Government signifying unconditional
acceptance of the above advice offered by the Imperial Japanese
Government, they will be compelled to take such action as they may
deem necessary to meet the situation. (D.O.W.) Speech by the
Japanese Prime Minister. (1' [Count THE Japanese Prime Minister(1)
in a speech last night w ^Okuma.] sai(j . Japan's object is to
eliminate from continental China the root of German influence, which
constitutes a constant menace to the peace of the Far East, and thus
to secure the aim of the alliance with Great Britain. She harbours no
design for territorial aggrandisement and entertains no desire to
promote any other selfish end. Japan's warlike operations will not,
therefore, extend beyond the limits necessary for the attainment of
that object and for the defence of her own legitimate interests.
Accordingly the Imperial Government has no hesitation in
announcing to the world that it will take no action such as to give to
the Powers any cause for anxiety or uneasiness regarding the safety
of their territories or possessions. (Press Bureau, August 20, 1914.)
296
The text on this page is estimated to be only 28.42%
accurate

GERMANY AND JAPAN Japanese Imperial Rescript declaring


War upon Germany, August 23, 1914. WE, by the Grace of Heaven,
Emperor of Japan, on the throne occupied by the same Dynasty
from time immemorial, do hereby make the following proclamation
to all Our loyal and brave subjects : — We, hereby, declare war
against Germany and We command Our Army and Navy to carry on
hostilities against that Empire with all their strength, and We also
command all Our competent authorities to make every effort in
pursuance of their respective duties to attain the national aim within
the limit of the law of nations. Since the outbreak of the present war
in Europe, the calamitous effect of which We view with grave
concern, We, on our part, have entertained hopes of preserving the
peace of the Far East by the maintenance of strict neutrality, but the
action of Germany has at length compelled Great Britain, Our Ally, to
open hostilities against that country, and Germany is at Kiao-chau,
its leased territory in China, busy with warlike preparations, while
her armed vessels, cruising the seas of Eastern Asia, are threatening
Our commerce and that of Our Ally. The peace of the Far East is
thus in jeopardy. Accordingly, Our Government, and that of His
Britannic Majesty, after a full and frank communication with each
other, agreed to take such measures as may be necessary for the
protection of the general interests contemplated in the Agreement of
Alliance, (1) and We on Our part, being desirous to attain (1> [See
that object by peaceful means, commanded Our Government P- 5°4-
J to offer, with sincerity, an advice to the Imperial German
Government. w By the last day appointed for the purpose, <2) [See
however, Our Government failed to receive an answer accept- p-
295.] ing their advice. It is with profound regret that We, in spite of
Our ardent devotion to the cause of peace, are thus compelled to
declare war, especially at this early period of Our reign and while we
are still in mourning for Our lamented Mother. It is Our earnest wish
that, by the loyalty and valour of Our faithful subjects, peace may
soon be restored and the glory of the Empire be enhanced. (The
Times, August 24, 1914.) 297
The text on this page is estimated to be only 28.33%
accurate

GERMANY AND JAPAN [SEPTEMBER [Minister SPEECH OF


BARON KATO(1) IN THE IMPERIAL DlET, TOKIO, ON Foreign
SEPTEMBER 5TH, 1914. A .££ * fl rs'^ (Translation from Japanese
Official Gazette. Courteously supplied by H.E. the Marquis Inouye,
Japanese Ambassador in London.} AFTER a brief survey of the
multifarious circumstances which led up to the present war, Baron
Kato said : Thus finding the peace of Europe hanging in the balance,
the Imperial Government could not view, but with grave concern,
the further developments of the situation. Deeming it necessary in
these circumstances to make their attitude clear to the public, the
Imperial Foreign Office issued a statement couched in the following
terms'21 on the 4th August. ' The Imperial Government can hardly
view the recent developments of the European situation but with
grave anxiety both out of political and economical considerations. It
is needless to say that it is the most earnest wish of the Imperial
Government to see the present conflict brought to a happy
conclusion and peace restored at the earliest possible moment. In
case, however, the present war is to be protracted against our
desire, the Imperial Government sincerely hope that the
conflagration could in all probability be confined to the localities now
affected by it and that they could maintain strict neutrality. As to the
further developments of the situation, however, we feel it our duty to
follow them with the closest possible attention. If England were
forced to enter into the rank of combatants and the aims of the
Anglo}[See Japanese Alliance (3) were jeopardised in consequence,
the p. 504-] Imperial Government might be obliged to resort to a
measure they deem fit for discharging the obligations laid upon
them by the agreement of the Alliance. It can scarcely be predicted
at the present moment whether the events would take such a course
as to bring about such a contingency. While entertaining the most
ardent wish that things of this kind may never happen, the Imperial
Government are nevertheless following the development of events
with the closest attention." As clearly stated in this statement, the
Imperial Government desired from the outset that the European
conflagration 298 W[c/. condensed statement transmitted by Renter,
p. 295.]
The text on this page is estimated to be only 29.12%
accurate

GERMANY AND JAPAN should never spread so widely as to


involve the Far East in its calamities. Great Britain, however, having
been compelled to participate in this war, at the beginning of August
requested the Imperial Government under the agreement of the
Alliance to render them assistance in the matter. At that time, the
British trade in the Far East was exposed to great danger owing to
the presence of the German war vessels in the Eastern Seas, and
our oversea trade was also impeded to no small extent, while at the
same time, in Kiau-chao, the German leased territory in the Far East,
every possible effort was made, day in and day out, to complete the
warlike preparations, with a view to making it the basis of Germany's
military operations in the Orient. The maintenance of peace was
thus rendered very difficult. As you are well aware, the agreement of
the Anglo- Japanese Alliance has for its object the consolidation and
maintenance of general peace in Eastern Asia, the preservation of
the independence and territorial integrity of China, the consecration
of the principle of equal opportunity in China, and, further, the
maintenance of the territorial rights of Great Britain and Japan in the
regions of Eastern Asia and India, and the defence of their special
interests in these regions. Now owing to the fact that her trade and
commerce in the Orient — to which great importance is attached by
her as one of her special interests in common with Japan — were
menaced by her enemies, Great Britain addressed her request to us
to render her such assistance as was in our power, and the Imperial
Government, whose foreign policy is based upon the Alliance, had no
alternative but to accede to this request and lend her their helping
hand in her hour of need. Moreover, the Imperial Government
deemed it not only a great impediment to the consolidation of
general peace in the Far East, but also prejudicial to the interest of
this Empire, that Germany, whose policy is prone to be at variance
with the aims of the Alliance, should possess a base for her influence
in the Far East. In these circumstances the Imperial Government
could not escape from the conclusion that it was inevitable that they
should draw the sword against Germany in compliance with the
demand of Great Britain. After having laid their view before His
Majesty the Emperor, and having obtained the Imperial approval
thereof, the Cabinet made a communication to this effect to the
British 299
The text on this page is estimated to be only 28.74%
accurate

GERMANY AND JAPAN [SEPTEMBER [c/. text in D.O.W., see


p. 295.] <2> [Presented to the German Government by Baron
Funakoshi on Aug. 17, according to D.O.W., c/. R. 66.] Government.
Following upon the heels of this communication, a frank and full
exchange of views took place between the two Governments, which
confirmed the Imperial Government in the view that it was a matter
of supreme importance that they should at once take suitable
measures for the protection and defence of general interests as
contemplated in the agreement of the Alliance. It need hardly be
said at this juncture that the Imperial Government had not the
slightest idea of plunging themselves into the turmoil of the present
struggle, but they deemed it their duty that they should endeavour
to ensure permanent peace in the Orient, safeguard the special
interests of our Ally, and uphold the spirit of the Alliance, thereby
consolidating its strength. The Imperial Government, actuated as
they were by the idea that it was best calculated to realise the
object in view if the settlement of the matter were achieved by
peaceful means even at the eleventh hour, decided to offer sincere
advice to the Imperial German Government. Accordingly the note
couched in the following terms (1) was handed over to the German
Government on the I5th August'2' : Considering it highly important
and necessary in the present situation to take measures to remove
all causes of disturbance to the peace of the Far East and to
safeguard the general interests contemplated by the agreement of
the Alliance between Japan and Great Britain in order to secure a
firm and enduring peace in Eastern Asia, the establishment of which
is the aim of the said agreement, the Imperial Japanese Government
sincerely believe it their duty to give advice to the Imperial German
Government to carry out the following two propositions : (1) To
withdraw immediately from the Japanese and Chinese waters
German men-of-war and armed vessels of all kinds and to disarm at
once those which cannot be withdrawn. (2) To deliver, on a date not
later than i5th September, to the Imperial Japanese Authorities,
without condition or compensation, the entire leased territory of
Kiau-chao, with a view to eventual restoration of the same to China.
300
The text on this page is estimated to be only 29.01%
accurate

GERMANY AND JAPAN The Imperial Government announce


at the same time that in the event of their not receiving by noon of
August 23rd, 1914, the answer of the Imperial German Government
signifying the unconditional acceptance of the above advice offered
by the Imperial Japanese Government, they will be compelled to
take such action as they may deem necessary to meet the situation.
The date prescribed in the above note, namely, 23rd August, passed,
but no reply was received from the German Government. The result
was the rupture of diplomatic relations between the two countries
and the state of war was brought into existence. As is still fresh in
your minds, the Imperial Rescript declaring war against Germany
(1> was issued in the m\See afternoon of 23rd August. p. 297.] In
regard to Austria-Hungary, her interests in the Orient are, so to
speak, infinitesimal. Besides, the Imperial Government, having no
interest in the Austro-Serbian dispute, which, as you know, is the
genesis of the present European conflict, had entertained the hope
that they could continue peaceful relations with the Dual Monarchy,
and they were given to understand that this hope was reciprocated
on the part of the latter, as is illustrated in the following instance. On
the eve of the outbreak of war against Germany, the Government of
Austria-Hungary, pointing out the presence of her cruiser Kaiser in
Elizabeth^ in the Far East, which she (2)[c/-R-69, feared might
constitute the only and sole chance of creating p' 293'^ hostile
relations between the two countries, signified her willingness to
instruct the said cruiser to proceed to Shanghai, a neutral port, and
remain there entirely dismantled for the duration of war between
Japan and Germany, and expressed the hope, at the same time, that
the Imperial Government would give the said cruiser suitable
guarantee, so as to enable her to sail from Kiau-chao to Shanghai in
peace. Having no occasion whatever to wage war against Austria-
Hungary, still less any necessity therefor, the Imperial Government
had the intention to let the Kaiserin Elizabeth sail to Shanghai in
peace as desired by Austria-Hungary, but just at that moment the
British men-of-war, placed under the Commanderin-Chief of our
Fleet, were already afloat for action in certain seas. We feared,
therefore, that, even though our warships 301
The text on this page is estimated to be only 29.35%
accurate

GERMANY AND JAPAN [SEPTEMBER did nothing towards


the Austrian cruiser, a British war vessel might open action against
her and frustrate our plan of letting her ply her course to Shanghai.
Under these circumstances, before giving consent to the Austrian
request, the Imperial Government brought their desire to the notice
of the British Government and obtained the reply from that quarter
to the effect that, in deference to the wishes of the Imperial
Government, they were ready to accede to the request of the
Austrian Government under certain conditions. Having thus procured
a satisfactory answer from our Ally, I was just on the point of
intimating our decision in regard to this matter to the Austrian
Ambassador here, when he informed me that he was in receipt of
instructions from his Government charging him to leave Tokio and
return home forthwith, and applied [See R. to me for the passports.
(1) It was much against my liking, but 690 in these circumstances I
had no alternative but to meet his request by handing him over the
required passports. Simultaneously, I sent instructions to our
Ambassador at Vienna to address a similar request to the
Government to which he was accredited and return home. These are
the circumstances which led up to the outbreak of war against
Germany and the rupture of diplomatic relations between Japan and
Austria-Hungary. Availing myself of this opportunity, I should like to
make reference to the courtesy shown by the Government of the
United States of America towards the Imperial Government in
connection with the present crisis. No sooner had the diplomatic
relations with Germany entered upon a very acute and critical stage
than the Imperial Government requested the American Government
that, in the event of the outbreak of war between Japan and
Germany, they would have the goodness to place all our public
establishments and our countrymen in Germany under their
protection. Later on, upon the rupture of diplomatic relations with
Austria-Hungary, we addressed a similar request to that
Government. On both occasions they readily acceded to our request
with willingness, and since then they have spared no pains in looking
after the welfare of our countrymen remaining in the enemy
countries. I feel sure I am giving a voice to the sentiments of the
House when I express, in the name of the Imperial Government, the
deep sense of gratitude 302
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