100% found this document useful (2 votes)
11 views

Brief Java Early Objects 9th Edition Cay Horstmanninstant download

The document provides information about the 9th edition of 'Brief Java Early Objects' by Cay Horstmann, including download links and recommended products related to Java programming. It highlights the book's focus on effective learning, gradual introduction to object-oriented design, and practical problem-solving strategies. The text is designed for beginners and covers essential programming concepts while integrating modern Java features and interactive learning activities.

Uploaded by

crucciamosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
11 views

Brief Java Early Objects 9th Edition Cay Horstmanninstant download

The document provides information about the 9th edition of 'Brief Java Early Objects' by Cay Horstmann, including download links and recommended products related to Java programming. It highlights the book's focus on effective learning, gradual introduction to object-oriented design, and practical problem-solving strategies. The text is designed for beginners and covers essential programming concepts while integrating modern Java features and interactive learning activities.

Uploaded by

crucciamosa
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Visit https://ebookultra.

com to download the full version and


browse more ebooks or textbooks

Brief Java Early Objects 9th Edition Cay Horstmann

_____ Press the link below to begin your download _____

https://ebookultra.com/download/brief-java-early-
objects-9th-edition-cay-horstmann/

Access ebookultra.com now to download high-quality


ebooks or textbooks
Here are some recommended products for you. Click the link to
download, or explore more at ebookultra.com

Java concepts 5th Edition Cay S. Horstmann

https://ebookultra.com/download/java-concepts-5th-edition-cay-s-
horstmann/

Java Concepts 5 Pap/Onl Edition Cay Horstmann

https://ebookultra.com/download/java-concepts-5-pap-onl-edition-cay-
horstmann/

Big Java Compatible with Java 5 6 and 7 4th Edition Cay S.


Horstmann

https://ebookultra.com/download/big-java-compatible-with-
java-5-6-and-7-4th-edition-cay-s-horstmann/

Python for Everyone 2nd Edition Cay Horstmann. Rance


Necaise

https://ebookultra.com/download/python-for-everyone-2nd-edition-cay-
horstmann-rance-necaise/
Java How to Program Early Objects 10th ed Edition Deitel

https://ebookultra.com/download/java-how-to-program-early-
objects-10th-ed-edition-deitel/

Starting Out with Java Early Objects 5th Edition Tony


Gaddis

https://ebookultra.com/download/starting-out-with-java-early-
objects-5th-edition-tony-gaddis/

Starting out with C Early objects 9th Global edition


Edition Gaddis

https://ebookultra.com/download/starting-out-with-c-early-objects-9th-
global-edition-edition-gaddis/

Starting Out with Java Early Objects 5 E 5th Edition Tony


Gaddis

https://ebookultra.com/download/starting-out-with-java-early-
objects-5-e-5th-edition-tony-gaddis/

Core Java Volume 1 Fundamentals 8th ed Edition Horstmann

https://ebookultra.com/download/core-java-volume-1-fundamentals-8th-
ed-edition-horstmann/
Brief Java Early Objects 9th Edition Cay Horstmann
Digital Instant Download
Author(s): Cay Horstmann
ISBN(s): 9781119499138, 1119499135
Edition: 9
File Details: PDF, 31.67 MB
Year: 2019
Language: english
9/e

Cay Horstmann

Brief Java
Early Objects
9/e

Brief Java
Early Objects

bbjeo_fm.indd 1 11/27/18 1:37 PM


bbjeo_fm.indd 2 11/27/18 1:37 PM
9/e

Brief Java Early Objects


© Jeremy Woodhouse/Holly Wilmeth/Getty Images.

Cay Horstmann
San Jose State University

bbjeo_fm.indd 3 11/27/18 1:37 PM


VICE PRESIDENT AND EXECUTIVE PUBLISHER Laurie Rosatone
EXECUTIVE EDITOR Joanna Dingle
PROJECT MANAGER/DEVELOPMENT EDITOR Cindy Johnson
EDITORIAL ASSISTANT Crystal Franks
LEAD PRODUCT DESIGNER Tom Kulesa
MARKETING MANAGER Michael MacDougald
PRODUCTION MANAGER Nichole Urban
PRODUCTION MANAGER Nicole Repasky
PRODUCTION MANAGEMENT SERVICES Cindy Johnson, Publishing Services
PHOTO EDITOR Anindita Adiyal
COVER DESIGNER Joanna Vieira
COVER PHOTOS (tiger) © ArtMediaFactory/Shutterstock;
(rhino) © GUDKOV ANDREY/Shutterstock;
(bird) © Jeremy Woodhouse/Holly Wilmeth/
Getty Images; (tree frog) © kuritafsheen/Getty
Images.

This book was set in 10.5/12 Stempel Garamond LT Std by Publishing Services, and printed and bound by Quad
Graphics/Versailles. The cover was printed by Quad Graphics/Versailles.

Founded in 1807, John Wiley & Sons, Inc. has been a valued source of knowledge and understanding for more
than 200 years, helping people around the world meet their needs and fulfill their aspirations. Our company is
built on a foundation of principles that include responsibility to the communities we serve and where we live
and work. In 2008, we launched a Corporate Citizenship Initiative, a global effort to address the environmental,
social, economic, and ethical challenges we face in our business. Among the issues we are addressing are carbon
impact, paper specifications and procurement, ethical conduct within our business and among our vendors,
and community and charitable support. For more information, please visit our website: www.wiley.com/go/
citizenship.

This book is printed on acid-free paper. ∞

Copyright © 2019, 2016 John Wiley & Sons, Inc. All rights reserved. No part of this publication may be repro-
duced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photo-
copying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United
States Copyright Act, without either the prior written permission of the Publisher, or authorization through
payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Dan-
vers, MA 01923, (978) 750-8400, fax (978) 646-8600, or on the Web at www.copyright.com. Requests to the
Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111
River Street, Hoboken, NJ 07030-5774, (201) 748-6011, fax (201) 748-6008.

Evaluation copies are provided to qualified academics and professionals for review purposes only, for use in
their courses during the next academic year. These copies are licensed and may not be sold or transferred to a
third party. Upon completion of the review period, please return the evaluation copy to Wiley. Return instruc-
tions and a free of charge return shipping label are available at: www.wiley.com/go/returnlabel. If you have
chosen to adopt this textbook for use in your course, please accept this book as your complimentary desk copy.
Outside of the United States, please contact your local representative.

ePUB ISBN 978-1-119-49913-8

Printed in the United States of America.

The inside back cover will contain printing identification and country of origin if omitted from this page. In
addition, if the ISBN on the back cover differs from the ISBN on this page, the one on the back cover is correct.

10 9 8 7 6 5 4 3 2 1
P R E FA C E

This book is an introduction to Java and computer programming that focuses on the
essentials—and on effective learning. The book is designed to serve a wide range of
student interests and abilities and is suitable for a first course in programming for
computer scientists, engineers, and students in other disciplines. No prior program-
ming experience is required, and only a modest amount of high school algebra is
needed.
Here are the key features of this book:
Start objects early, teach object orientation gradually.
In Chapter 2, students learn how to use objects and classes from the standard library.
Chapter 3 shows the mechanics of implementing classes from a given specification.
Students then use simple objects as they master branches, loops, and arrays. Object-
oriented design starts in Chapter 8. This gradual approach allows students to use
objects throughout their study of the core algorithmic topics, without teaching bad
habits that must be un-learned later.
Guidance and worked examples help students succeed.
Beginning programmers often ask “How do I start? Now what do I do?” Of course,
an activity as complex as programming cannot be reduced to cookbook-style instruc-
tions. However, step-by-step guidance is immensely helpful for building confidence
and providing an outline for the task at hand. “How To” guides help students with
common programming tasks. Numerous Worked Examples demonstrate how to
apply chapter concepts to interesting problems.
Problem solving strategies are made explicit.
Practical, step-by-step illustrations of techniques help students devise and evaluate
solutions to programming problems. Introduced where they are most relevant, these
strategies address barriers to success for many students. Strategies included are:
• Algorithm Design (with pseudocode) • Solve a Simpler Problem First
• Tracing Objects • Adapting Algorithms
• First Do It By Hand (doing sample • Discovering Algorithms by
calculations by hand) Manipulating Physical Objects
• Flowcharts • Patterns for Object Data
• Selecting Test Cases • Thinking Recursively
• Hand-Tracing • Estimating the Running Time of
• Storyboards an Algorithm

Practice makes perfect.


Of course, programming students need to be able to implement nontrivial programs,
but they first need to have the confidence that they can succeed. Each section con-
tains numerous exercises that ask students to carry out progressively more complex
tasks: trace code and understand its effects, produce program snippets from prepared
parts, and complete simple programs. Additional review and programming problems
are provided at the end of each chapter.

bbjeo_fm.indd 5 11/27/18 1:37 PM


vi Preface

A visual approach motivates the reader and eases navigation.


Photographs present visual analogies that explain the
nature and behavior of computer concepts. Step-by-
step figures illustrate complex program operations.
Syntax boxes and example tables present a variety
of typical and special cases in a compact format. It
is easy to get the “lay of the land” by browsing the
visuals, before focusing on the textual material.
Focus on the essentials while being
technically accurate. Visual features help the reader
An encyclopedic coverage is not helpful for a begin- with navigation.
ning programmer, but neither is the opposite—
reducing the material to a list of simplistic bullet points. In this book, the essentials are
presented in digestible chunks, with separate notes that go deeper into good practices
or language features when the reader is ready for the additional information. You will
© Terraxplorer/iStockphoto.
not find artificial over-simplifications that give an illusion of knowledge.
Reinforce sound engineering practices.
A multitude of useful tips on software quality and common errors encourage the
development of good programming habits. The optional testing track focuses on
test-driven development, encouraging students to test their programs systematically.
Provide an optional graphics track.
Graphical shapes are splendid examples of objects. Many students enjoy writing pro-
grams that create drawings or use graphical user interfaces. If desired, these topics can
be integrated into the course by using the materials at the end of Chapters 2, 3, and 10.
Engage with optional science and business exercises.
End-of-chapter exercises are enhanced with problems from scientific and business
domains. Designed to engage students, the exercises illustrate the value of program-
ming in applied fields.

New to This Edition


Adapted to Java Versions 8 Through 11
This edition takes advantage of modern Java features when they are pedagogically
sensible. I continue to use “pure” interfaces with only abstract methods. Default,
static, and private interface methods are introduced in a Special Topic. Lambda
expressions are optional for user interface callback.
The “diamond” syntax for generic classes is introduced as a Special Topic in Chap-
ter 7 and used systematically starting with Chapter 15. Local type inference with the
var keyword is described in a Special Topic. Useful features such as the try-with-
resources statement are integrated into the text.

Interactive Learning
With this edition, interactive content is front and center. Immersive activities integrate
with this text and engage students in activities designed to foster in-depth learning.
Students don’t just watch animations and code traces, they work on generating
them. Live code samples invite the reader to experiment and to learn programming

bbjeo_fm.indd 6 11/27/18 1:37 PM


Preface vii

constructs first hand. The activities provide instant feedback to show students what
they did right and where they need to study more.

A Tour of the Book


The book can be naturally grouped into three parts, as illustrated by Figure 1. The
organization of chapters offers the same flexibility as the previous edition; dependen-
cies among the chapters are also shown in the figure.

Part A: Fundamentals (Chapters 1–7)


Chapter 1 contains a brief introduction to computer science and Java programming.
Chapter 2 shows how to manipulate objects of predefined classes. In Chapter 3,

1. Introduction

Fundamentals
2. Using Objects
Object-Oriented Design
Data Structures & Algorithms
e eText Chapters
3. Implementing
Classes

4. Fundamental
Data Types

5. Decisions

6. Loops

Sections 11.1 and 11.2


(text file processing) can be 7. Arrays
covered with Chapter 6. 6. Iteration
and Array Lists

11. Input/Output 8. Designing


13. Recursion
e
and Exception Classes
Handling

15. The Java 14. Sorting and


9. Inheritance
e
Collections Searching

e
Framework

10. Interfaces

Figure 1
Chapter 12. Object-
Oriented Design
Dependencies

bbjeo_fm.indd 7 11/27/18 1:37 PM


viii Preface

you will build your own simple classes from given specifications. Fundamental data
types, branches, loops, and arrays are covered in Chapters 4–7.

Part B: Object-Oriented Design (Chapters 8–12)


Chapter 8 takes up the subject of class design in a systematic fashion, and it intro-
duces a very simple subset of the UML notation. Chapter 9 covers inheritance and
polymorphism, whereas Chapter 10 covers interfaces. Exception handling and basic
file input/output are covered in Chapter 11. The exception hierarchy gives a useful
example for inheritance. Chapter 12 contains an introduction to object-oriented
design, including two significant case studies.

Part C: Data Structures and Algorithms (Chapters 13–15)


Chapters 13 through 15 (in the eText) contain an introduction to algorithms and
data structures, covering recursion, sorting and searching, and the Java Collections
Framework. These topics may be outside the scope of a one-semester course, but can
be covered as desired after Chapter 7 (see Figure 1). Recursion, in Chapter 13, starts
with simple examples and progresses to meaningful applications that would be dif-
ficult to implement iteratively. Chapter 14 covers quadratic sorting algorithms as well
as merge sort, with an informal introduction to big-Oh notation. Each data structure
is presented in the context of the standard Java collections library. You will learn the
essential abstractions of the standard library (such as iterators, sets, and maps) as well
as the performance characteristics of the various collections.

Appendices
Many instructors find it highly beneficial to require a consistent style for all assign-
ments. If the style guide in Appendix E conflicts with instructor sentiment or local
customs, however, it is available in electronic form so that it can be modified. Appen-
dices F–J are available in the eText.
A. The Basic Latin and Latin-1 Subsets of Unicode
B. Java Operator Summary
C. Java Reserved Word Summary
D. The Java Library
E. Java Language Coding Guidelines
F. Tool Summary
G. Number Systems
H. UML Summary
I. Java Syntax Summary
J. HTML Summary

Interactive eText Designed for Programming Students


Available online through wiley.com, vitalsource.com, or at your local bookstore, the
enhanced eText features integrated student coding activities that foster in-depth
learning. Designed by Cay Horstmann, these activities provide instant feedback to
show students what they did right and where they need to study more. Students do
more than just watch animations and code traces; they work on generating them right
in the eText environment. For a preview of these activities, check out http://wiley.
com/college/sc/horstmann.

bbjeo_fm.indd 8 11/27/18 1:37 PM


Preface ix

Customized formats are also available in both print and digital formats and pro-
vide your students with curated content based on your unique syllabus.
Please contact your Wiley sales rep for more information about any of these
options.

Web Resources
This book is complemented by a complete suite of online resources. Go to www.wiley.
com/go/bjeo7 to visit the online companion sites, which include

• Source code for all example programs in the book and its Worked Examples, plus
additional example programs.
• Worked Examples that apply the problem-solving steps in the book to other
realistic examples.
• Lecture presentation slides (for instructors only).
• Solutions to all review and programming exercises (for instructors only).
• A test bank that focuses on skills, not just terminology (for instructors only). This
extensive set of multiple-choice questions can be used with a word processor or
imported into a course management system.
• CodeCheck®, an innovative online service that allows instructors to design their
own automatically graded programming exercises.

bbjeo_fm.indd 9 11/27/18 1:37 PM


x Walkthrough

Walkthrough of the Learning Aids


The pedagogical elements in this book work together to focus on and reinforce key
concepts and fundamental principles of programming, with additional tips and detail
organized to support and deepen these fundamentals. In addition to traditional
features, such as chapter objectives and a wealth of exercises, each chapter contains
elements geared to today’s visual learner.

6.3 The for Loop 183

6.3 The for Loop


Throughout each chapter,
margin notes show where The for loop is used
when a value runs
It often happens that you want to execute a sequence of statements a given number of
times. You can use a while loop that is controlled by a counter, as in the following
new concepts are introduced from a starting point
to an ending point
example:
with a constant int counter = 5; // Initialize the counter
and provide an outline of key ideas. increment or while (counter <= 10) // Check the counter
decrement. {
sum = sum + counter;
counter++; // Update the counter
}

Because this loop type is so common, there is a spe-


cial form for it, called the for loop (see Syntax 6.2).
for (int counter = 5; counter <= 10; counter++)
{
sum = sum + counter;
}

Some people call this loop count-controlled. In con-


trast, the while loop of the preceding section can
be called an event-controlled loop because it exe-
cutes until an event occurs; namely that the balance
reaches the target. Another commonly used term for
a count-controlled loop is definite. You know from
the outset that the loop body will be executed a defi-
nite number of times; ten times in our example. In
© Enrico Fianchini/iStockphoto.
contrast, you do not know how many iterations it
takes to accumulate a target balance. Such a loop is You can visualize the for loop as
Annotated syntax boxes called indefinite. an orderly sequence of steps.

provide a quick, visual overview


of new language constructs. Syntax 6.2 for Statement

Syntax for (initialization; condition; update)


{
statements
}
These three
expressions should be related.
See Programming Tip 6.1.

Annotations explain required This initialization The condition is This update is


components and point to more happens once
before the loop starts.
checked before
each iteration.
executed after
each iteration.
information on common errors
for (int i = 5; i <= 10; i++)
or best practices associated The variable i is
{
sum = sum + i; This loop executes 6 times.
with the syntax. defined only in this for loop.
See Special Topic 6.1.
} See Programming Tip 6.3.

Analogies to everyday objects are


used to explain the nature and behavior
of concepts such as variables, data
Like a variable in a computer types, loops, and more.
program, a parking space has
an identifier and a contents.

bbjeo_fm.indd 10 11/27/18 1:37 PM


Walkthrough xi

Memorable photos reinforce


analogies and help students
remember the concepts.

In the same way that there can be a street named “Main Street” in different cities,
a Java program can have multiple variables with the same name.

Problem Solving sections teach


techniques for generating ideas and 7.5 Problem Solving: Discovering Algorithms by Manipulating Physical Objects 333

evaluating proposed solutions, often Now how does that help us with our problem, switching the first and the second
using pencil and paper or other half of the array?
Let’s put the first coin into place, by swapping it with the fifth coin. However, as
artifacts. These sections emphasize Java programmers, we will say that we swap the coins in positions 0 and 4:

that most of the planning and problem


solving that makes students successful
happens away from the computer.

Next, we swap the coins in positions 1 and 5:

HOW TO 6.1 How To guides give step-by-step


Writing a Loop
guidance for common programming
This How To walks you through the process of
implementing a loop statement. We will illustrate the tasks, emphasizing planning and
steps with the following example problem.
Problem Statement Read twelve temperature
testing. They answer the beginner’s
values (one for each month) and display the num-
ber of the month with the highest temperature. For
question, “Now what do I do?” and
example, according to http://worldclimate.com, the
average maximum temperatures for Death Valley are
integrate key concepts into a
(in order by month, in degrees Celsius):
problem-solving sequence.
18.2 22.6 26.4 31.1 36.6 42.2
45.7 44.5 40.2 33.1 24.2 17.6
In this case, the month with the highest tempera-
ture (45.7 degrees Celsius) is July, and the program
should display 7. © Stevegeer/iStockphoto.

Step 1 Decide what work must be done inside the loop. Worked Examples apply
Every loop needs to do some kind of repetitive work, such as
• Reading another item. the steps in the How To to a
• Updating a value (such as a bank balance or total).
WORKED EXAMPLE 6.1 different example, showing
• Incrementing a counter.
Credit Card Processing
If you can’t figure out what needs to go inside the loop, start by writing down the steps that how they can be used to
you would take if you
howsolved
to use the problem by hand. Forfrom
example, with the temperature reading
problem, you
Learn
might See
number. write
a loop to remove spaces a credit
your eText or visit wiley.com/go/bjeo7.
card
plan, implement, and test
© MorePixels/iStockphoto. a solution to another
programming problem.
Table 1 Variable Declarations in Java
Variable Name Comment

int width = 20; Declares an integer variable and initializes it with 20.

int perimeter = 4 * width; The initial value need not be a fixed value. (Of course, width
must have been previously declared.)

String greeting = "Hi!"; This variable has the type String and is initialized with the
Example tables support beginners
string “Hi”. with multiple, concrete examples.
height = 30; Error: The type is missing. This statement is not a declaration
but an assignment of a new value to an existing variable—see These tables point out common
Section 2.2.5.
errors and present another quick
int width = "20"; Error: You cannot initialize a number with the string “20”.
(Note the quotation marks.) reference to the section’s topic.
int width; Declares an integer variable without initializing it. This can be a
cause for errors—see Common Error 2.1.
int width, height; Declares two integer variables in a single statement. In this
book, we will declare each variable in a separate statement.

bbjeo_fm.indd 11 11/27/18 1:37 PM


xii Walkthrough

Figure 3
Progressive figures trace code Execution of a
1 Initialize counter
for (int counter = 5; counter <= 10; counter++)
{
for Loop
segments to help students visualize counter = 5 }
sum = sum + counter;

the program flow. Color is used


consistently to make variables and
2 Check condition
for (int counter = 5; counter <= 10; counter++)
{

other elements easily recognizable. counter = 5 }


sum = sum + counter;

3 Execute loop body


for (int counter = 5; counter <= 10; counter++)
{
sum = sum + counter;
counter = 5 }

4 Update counter
for (int counter = 5; counter <= 10; counter++)
{
sum = sum + counter;
counter = 6 }
sec01/ElevatorSimulation.java
1 import java.util.Scanner; 5 Check condition again
for (int counter = 5; counter <= 10; counter++)
2 {
3 /** sum = sum + counter;
4 This program simulates an elevator panel that skips the 13th floor. counter = 6 }
5 */
6 public class ElevatorSimulation
7 {
8 public static void main(String[] args)
9 { The for loop neatly groups the initialization, condition, and update expressions
10 Scanner in = new Scanner(System.in); together. However, it is important to realize that these expressions are not executed
11 System.out.print("Floor: ");
together (see Figure 3).
12 int floor = in.nextInt();
13
• The initialization is executed once, before the loop is entered. 1
14 // Adjust floor if necessary
15 • The condition is checked before each iteration. 2 5
16 int actualFloor;
17 if (floor > 13) • The update is executed after each iteration. 4

Program listings are carefully


designed for easy reading, going
well beyond simple color coding.
Students can run and change the
same programs right in the eText.

Self-check exercises in the


eText are designed to engage
students with the new material
and check understanding before
they continue to the next topic.

•• Business E6.17 Currency conversion. Write a program


that first asks the user to type today’s
price for one dollar in Japanese yen,
then reads U.S. dollar values and
converts each to yen. Use 0 as a sentinel.

Optional science and business • Science P6.15 Radioactive decay of radioactive materials can be
modeled by the equation A = A0e-t (log 2/h), where A is
exercises engage students with the amount of the material at time t, A0 is the amount
realistic applications of Java. at time 0, and h is the half-life.
Technetium-99 is a radioisotope that is used in imaging
of the brain. It has a half-life of 6 hours. Your program
should display the relative amount A / A0 in a patient
body every hour for 24 hours after receiving a dose.

bbjeo_fm.indd 12 11/27/18 1:37 PM


Walkthrough xiii

Common Errors describe the kinds Common Error 7.4

of errors that students often make, Length and Size


Unfortunately, the Java syntax for determining the number of elements in an array, an array
with an explanation of why the errors list, and a string is not at all consistent. It is a common error to confuse these. You just have to
remember the correct syntax for every data type.
occur, and what to do about them.
Data Type Number of Elements

Array a.length

Array list a.size()

String a.length()

Programming Tip 5.5


Hand-Tracing
A very useful technique for understanding whether a program
works correctly is called hand-tracing. You simulate the pro-
gram’s activity on a sheet of paper. You can use this method with
pseudocode or Java code.
Get an index card, a cocktail napkin, or whatever sheet of
Programming Tips explain paper is within reach. Make a column for each variable. Have the
program code ready. Use a marker, such as a paper clip, to mark
good programming practices, the current statement. In your mind, execute statements one at a
time. Every time the value of a variable changes, cross out the old
and encourage students to be value and write the new value below the old one.
For example, let’s trace the getTax method with the data from © thomasd007/iStockphoto.

more productive with tips and the program run above. When the TaxReturn object is constructed,
the income instance variable is set to 80,000 and status is set to
Hand-tracing helps you
understand whether a
techniques such as hand-tracing. MARRIED. Then the getTax method is called. In lines 31 and 32 of Tax-
Return.java, tax1 and tax2 are initialized to 0.
program works correctly.

29 public double getTax()


30 {
31 double tax1 = 0; income status tax1 tax2
32 double tax2 = 0;
33 80000 MARRIED 0 0
Because status is not SINGLE, we move to the else
branch of the outer if statement (line 46).
34 if (status == SINGLE)
35 {
36 if (income <= RATE1_SINGLE_LIMIT)
37 {
38 tax1 = RATE1 * income;
39 }
40 else
41 {
42 tax1 = RATE1 * RATE1_SINGLE_LIMIT;
43 tax2 = RATE2 * (income - RATE1_SINGLE_LIMIT);

Special Topic 11.2


File Dialog Boxes

Special Topics present optional In a program with a graphical user interface, you will want to use a file dialog box (such as the
one shown in the figure below) whenever the users of your program need to pick a file. The
topics and provide additional JFileChooser class implements a file dialog box for the Swing user-interface toolkit.
The JFileChooser class has many options to fine-tune the display of the dialog box, but in its
explanation of others. most basic form it is quite simple: Construct a file chooser object; then call the showOpenDialog
or showSaveDialog method. Both methods show the same dialog box, but the button for select-
ing a file is labeled “Open” or “Save”, depending on which method you call.
For better placement of the dialog box on the screen, you can specify the user-interface
component over which to pop up the dialog box. If you don’t care where the dialog box pops
up, you can simply pass null. The showOpenDialog and showSaveDialog methods return either
JFileChooser.APPROVE_OPTION, if the user has chosen a file, or JFileChooser.CANCEL_OPTION, if the
user canceled the selection. If a file was chosen, then you call the getSelectedFile method to
obtain a File object that describes the file.
Here is a complete example:
JFileChooser chooser = new JFileChooser();
Scanner in = null;
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION)
{

Additional full code examples


File selectedFile = chooser.getSelectedFile();
in = new Scanner(selectedFile);

throughout the text provide }

complete programs for students EXAMPLE CODE See special_topic_2 of your eText or companion code for a program that demonstrates how to use a file
chooser.

to run and modify.

Computing & Society 1.1 Computers Are Everywhere


When computers The advent of ubiqui-
were first invented tous computing changed
in the 1940s, a computer filled an many aspects of our
entire room. The photo below shows lives. Factories used
the ENIAC (electronic numerical inte- to employ people to
grator and computer), completed in do repetitive assembly
1946 at the University of Pennsylvania. tasks that are today car-
The ENIAC was used by the military ried out by computer-

Computing & Society presents social


to compute the trajectories of projec- controlled robots, oper-
tiles. Nowadays, computing facilities ated by a few people
of search engines, Internet shops, and who know how to work
and historical topics on computing—for social networks fill huge buildings
called data centers. At the other end of
with those computers.
Books, music, and mov-
interest and to fulfill the “historical and the spectrum, computers are all around
us. Your cell phone has a computer
ies are nowadays often
consumed on com- This transit card contains a computer.
social context” requirements of the inside, as do many credit cards and fare
cards for public transit. A modern car
puters, and comput-
ers are almost always

ACM/IEEE curriculum guidelines. has several computers––to control the


engine, brakes, lights, and the radio.
involved in their production. The
book that you are reading right now
could not have been written without
computers.

bbjeo_fm.indd 13 11/27/18 1:37 PM


Exploring the Variety of Random
Documents with Different Content
following their instructions. Literally that is what it says. Yet I
suppose that even a man who does not know Greek may feel in an
instinctive way that it may be extraordinarily good in the original. It
is. It is an instance of the famous Laconic brevity, whose virtue it
was to cut at once to the heart of things. One other epigram I will
add, partly because it also refers to the time of the Persian Wars,
partly because the author was said (perhaps rightly) to be Plato. It is
on the people of Eretria, a town in Euboea by the seashore, who
were carried off into captivity and settled by Darius far away,
hopelessly far, “at Arderikka in the Kissian land” beyond the Tigris.
We who one day left the deep-voiced swell of the Aegean lie here
midmost the Plain of Ecbatana. Good-bye Eretria, our city famous
once; good-bye Athens, the neighbour of Eretria; good-bye dear
sea. By the side of this mere “pathos” looks almost vulgar. If Plato
wrote it, he was certainly a poet; but it is improbable that he did. I
notice that Professor Burnet thinks Plato did not write any of the
poems attributed to him in the manuscripts. In any case, when
people say that Plato was “really a poet” they are thinking of his
prose. I cannot help adding the irrelevancy that I wish they would
not go on repeating this. He is an incomparably great master of
imaginative prose. Is that not enough? He may have been no better
at poetry than Ruskin or Carlyle. A poet is a man who writes poems.
Next to death the great test of sincerity is love. There used to be a
general opinion that love, as we understand it, did not exist among
the ancients at all. That point has been already discussed, but we
may consider for a little the treatment of love in the Attic dramatists,
who best represent the great period of Athenian development. There
is plenty of love in them, only they don’t mention it. “Please
(Note 195)do not be impatient,” as the Greek orators say, “until you
hear what I mean.” Let us take Aeschylus, the earliest of the
dramatists, first, and for a play let us take his Agamemnon. The
great character is Clytaemnestra. She has allowed herself to become
the paramour of a vile and cowardly relation of her husband called
Aegisthus, who apparently seduced her out of mere idleness and
hatred of King Agamemnon. When her husband returns she
treacherously murders him.... What are you going to make of a
subject like that? How are you going to make Clytaemnestra, I will
not say “sympathetic,” but merely human and tolerable? It seems an
insoluble problem. Yet Aeschylus solves it. For one thing, he
represents Agamemnon, the nominal hero of the play, as rather
wooden, weak and bombastic—not very unlike Julius Caesar, the
nominal hero of Shakespeare’s play, where the dramatist had a
similar but less difficult problem. The result is that the sympathies of
the reader are not too deeply stirred in favour of the victim. Again,
Clytaemnestra appears to be really in love with Aegisthus, while her
feeling towards her husband is not merely the thirst for revenge or
the hate a woman conceives of the man she has wronged; it is a
physical abhorrence. She loathes him in her flesh. It is impossible to
explain by what miracle of genius we are led to receive this
impression, for she speaks nothing but flatteries and cajolery. Yet
every speech of hers to him, as he dimly feels, shudders with a
secret disgust. These long, glittering, coiling sentences are certainly
not politic; they are the expression of a morbid loathing, which has
ended by fascinating itself. When the blood of her lord
(Note 196)bursts over her she rejoices no less than the sown ground
in the heaven’s bright gift of rain. Now in the play Agamemnon is
rather ineffective, but at any rate he is more a man than the
immeasurably contemptible Aegisthus. Is it to be supposed that
Clytaemnestra does not know that? Of course she knows, but she
does not cease to love Aegisthus on that account. So the matter
stands. Aeschylus does not make it any easier for you. A bad
modern playwright would make Clytaemnestra a sadly
misunderstood woman with a pitiful “case.” It so happens that the
queen does have something of a case, really a good case, but she
does not much insist on it. She knows quite well that it is not for her
murdered daughter’s sake that she has killed the king. Neither is it
from fear of detection; the woman does not know the meaning of
fear. Aeschylus will not purchase your sympathy for her by any
pretences. One of his unexpected, wonderful touches is to make her
superbly intelligent. She feels herself so much superior intellectually
to every one else that she hardly takes the trouble to deceive them.
Nobody is asked to like Clytaemnestra, but surely she gives food for
some reflection on the power and subtlety of Greek psychology, and
the unswerving truthfulness of Greek realism, in a peculiarly complex
affair of the heart.
There are in Sophocles at least two fine and tender studies of
conjugal love of the conventional (but not silly conventional) type,
namely Tekmessa in the Ajax and Dêianeira in the Trachinian
Women; and one study not conventional in the very least, the
Iokasta of Oedipus the King. She is the woman who slew herself
because she had borne children to her own son, who had murdered
his father, who begot him by her. The legend has made her a thing
of night and horror. Sophocles has made her grand, proud, sceptical,
lonely, pitiful, ravaged by thoughts not to be breathed, horribly
pathetic. But these three are wives. Of love between man and maid
Sophocles has hardly a word to say. People quote Haimon and
Antigone. There is no doubt of the young man’s love for Antigone;
he dies for her. But is she in love with Haimon? She is betrothed to
him of course, but in ancient Greece these matters were arranged.
She probably liked him a good deal; everybody likes him; but we are
speaking of love. Those who have little doubts on the subject quote
her cry, Dearest Haimon, how thy father slights thee! which she
utters when Kreon has said, I hate bad wives for my sons. But they
have no right to quote the cry as hers until they have proved she
utters it; which they don’t, but merely assume the manuscripts be
wrong. The manuscripts give the line to Ismênê, the sister of
Antigone, and they appear to be clearly right. Any one who looks at
the context will see that it is Ismênê who brings the mention of
Haimon into the dispute with Kreon. Antigone stands apart in proud
and indignant silence. She will die rather than let the man who has
outraged her dead brother see how much her resistance is costing
her. Besides, I think the manuscripts are right anyway. Imagine the
case of an extremely high-minded young lady, who for the very best
reasons has quarrelled with her prospective father-in-law. The young
lady’s sister reminds the old man that after all Octavia is engaged to
his son, which provokes the retort, “I object to bad wives for my
boys.” Would Octavia then exclaim, “Dearest William, how your
father insults you!”? Well, would she? But it looks delightfully like
what Octavia’s sister would say. Therefore, I vote for the
manuscripts and giving the line to Ismênê.
Antigone had two brothers, Eteokles and Polyneikes. After their
father had been driven from Thebes the brethren disputed the
succession to his throne. Polyneikes lost, and took refuge in Argos,
where he gathered assistance and marched against his native city.
The attempt had no success, and Polyneikes and Eteokles fell in
single combat. This mutual fratricide left Kreon, their uncle, king. He,
in a flame of “patriotism,” had Eteokles interred with honour and
commanded that the body of Polyneikes should be left unburied.
Such an order might be compared to excommunication, for the
effect of it was for ever to bar the spirit of the dead from peace.
Antigone sprinkled dust on the naked corpse, which satisfied the
gods of the underworld and eluded the penalty of the ban. When
Kreon asks her if the spirit of Eteokles will not resent the saining of
his fraternal enemy—which would be the orthodox opinion—she
replies, beautifully but inconsequently, It is not my nature to join in
hating, but in loving. She also speaks of a higher, unwritten law. But
Polyneikes is the favourite brother. I hardly think any one can read
carefully the Antigone and the Oedipus at Colonus without seeing
that. All through the Antigone he is never out of her thoughts.
“Natural enough,” you may be inclined to say. But is it? On the
supposition that she is in love with Haimon? There is another play,
the Electra, in which Sophocles portrays the love of a sister for a
brother; and there are a good many points of resemblance between
Electra and Antigone. Only there is in the love of Electra for Orestes
(whom she brought up) a fierce, hungry, maternal quality, which
would be out of place between the children of Oedipus.
When we pass to Euripides we seem by comparison to approach the
modern. The impression is largely illusory, but not wholly false. It is
the fact that he is troubled by many of the problems that trouble us,
and it is the fact that he sometimes answers, or does not answer,
them in a way we should regard as modern. This comes out in his
treatment of love. It is best seen in the Medea and the Hippolytus.
Medea has a special interest for us because she is a Barbarian
(princess of Colchis in the eastern corner of the Black Sea). But her
case is quite simple. She is a woman in love with a man who is tired
of her. Necessarily he cuts a poor figure in the story. She had saved
his life. On the other hand, she had thrown herself at his head, she
had done her best to ruin his chances in life, and all she had now to
offer him was a perfect readiness to murder anybody who stood in
his way. She is one of those women who are never satisfied unless
the man is making love to them all the time, so that one may have a
sneaking sympathy for that embarrassed, if rather contemptible,
Jason. Indeed, Euripides’ opinion of this kind of “Romantic” love is
probably no higher than Mr. Shaw’s. It is the passion of the
Barbarian woman. That does not prevent Euripides from
sympathizing profoundly with Medea, the passionate, wronged,
foreign woman. Why, indeed, should it? The case of Medea, as
Euripides with the pregnant brevity of Greek art presents it, has
seemed to many as true as death. It is an excellent example of
realism.
More definitely than the Medea, the Hippolytus is a tragedy of love.
Yet in the eloquence of the Romantic lover the one is as deficient as
the other. Phaedra was dying for love of Hippolytus. Her secret is
discovered and she dies of shame. What an opportunity for the
sentimentalist! However, adds the relentless poet, that is not all the
story. Before killing herself she forged a message to her husband
making the charge of Potiphar’s wife against Hippolytus. She could
not die without the pleasure of hurting him. Yet Euripides does not
represent her as an odious woman; quite the contrary. The question
for us is, does she, when we read the play, strike us as real or not?
The poet has set himself a difficult task—to convince us that a soul
overthrown by desire, cruel, lying, unjust was yet essentially modest,
gentle and honourable. If she is almost too convincing, so that a
sentimental part of you bleeds inside, you will perceive that realism
was not invented in Norway. And there is this about the Greek sort:
it never exaggerates.
It is hardly to be believed how startling an effect of truth this
moderation of the Greek writers can produce. Sappho, in the most
famous of her odes, says that love makes her “sweat” with agony
and look “greener than grass.” Perhaps she did not turn quite so
green as that, although (commentators nobly observe) she would be
of an olive complexion and had never seen British grass. But, even if
it contain a trace of artistic exaggeration, the ode as a whole is
perhaps the most convincing love-poem ever written. It breathes
veracity. It has an intoxicating beauty of sound and suggestion, and
it is as exact as a physiological treatise. The Greeks can do that kind
of thing. Somehow we either overdo the “beauty” or we overdo the
physiology. The weakness of the Barbarian, said they, is that he
never hits the mean. But the Greek poet seems to do it every time.
We may beat them at other things, but not at that. And they do it
with so little effort; sometimes, it might appear, with none at all.
Thus Aeschylus represents Prometheus as the proudest of living
beings. The Prometheus Bound opens with a scene in which
Hephaistos, urged on by two devils called Strength and Force, nails
Prometheus to a frozen, desert rock. While the hero of the play
endures this horrible torture, he has to listen to the clumsy
sympathy of Hephaistos, who does not like his job, and the savage
taunts of the two demons. To all this he replies—nothing at all. No
eloquence could express the pride of that tremendous silence. Of
course there is, or there used to be, a certain kind of commentator
who hastens to point out that a convention of the early Attic stage
forbade more than two persons of a tragedy to speak together at
any time, so that in any event it was not permissible for Prometheus
to speak. All you can do with a critic like that is (mentally, I fear) to
hang a millstone round his neck and cast him into the deepest part
of the sea.
Not but what the point about convention, if rightly taken, is
extremely notable. It is an undying wonder how the kind of realism
we have been discussing could be combined with, could even, as in
that instance from the Prometheus Bound, make use of, the
limitations imposed on the ancient poet. To a reader who has not
looked into the case it is hard to give even an idea of it. If a man
were to tell you that he had written a novel in which the hero was
Sir Anthony Dearborn and the heroine Sophia Wilde, while other
characters were Squire Crabtree, Parson Quackenboss, Lieutenant
Dashwood and the old Duchess of Grimthorpe, you would think to
yourself you knew exactly what to expect. Yet you must admit there
is nothing to prevent the man leaving out (if he can) Gretna Green,
and the duel, and the eighteenth-century oaths. But if a Greek tragic
dramatist put on the stage a play dealing, say, with the House of
Atreus, he positively could not leave out any part of the family
history. It was not done. So the audience knew your story already,
and knew, roughly, your characters. Nor, as historians say, was that
all. There had to be a Chorus, which had to sing lyrical odes of a
mythological sort at regular intervals between the episodes of your
drama; while the episodes themselves had to be composed in the
iambic metre and in a certain “tragic diction” about as remote from
ordinary speech as Paradise Lost. How Aeschylus and Sophocles and
Euripides contrive under such conditions to give a powerful
impression of novelty and naturalness it is easier to feel than
explain. About the feeling at least there is no doubt. Let us look
again for a moment at that singular convention, the tragic Chorus.
Very often it consists of old men who ... sing and dance. Consider
the incredible difficulty of keeping a number of singing and dancing
old men solemn and beautiful and even holy. Yet the great tragic
poets have overcome that difficulty so completely that I suppose not
one reader in a hundred notices that there is a difficulty at all. The
famous Chorus of old men in the Agamemnon, whose debility is
made a point in the play, never for a moment remind one of
Grandfer Cantle. Rather they remind us of that “old man covered
with a mantle,” whom Saul beheld rising from the grave to
pronounce his doom. It is, in their own words, as if God inspired
their limbs to the dance and filled their mouths with prophecy.
There is only one way of redeeming the conventional, and that is by
sincerity. I am very far from maintaining that the moral virtue of
sincerity was eminently characteristic of the ancient Greek; but
intellectual sincerity was. None has ever looked upon gods and men
with such clear, unswerving eyes; none has understood so well to
communicate that vision. To see that essential beauty is truth and
truth is beauty—that is the secret of Greek art, as it is the maxim of
true realism. To keep measure in all things, that no drop of life may
spill over—that is the secret of Greek happiness. To be a Greek and
not a Barbarian.
NOTES
THE AWAKENING

The beginnings of Ionia, the earlier homes and the racial affinities of the Ionians,
are still obscure, although the point is cardinal for Greek history. There is perhaps
a growing tendency to find “Mediterranean” elements in the Ionian stock, and this
would explain much, if the Ionians of history did not seem so very “Aryan” in
speech and habits of thought. On the other hand the “Aryan” himself is daily
coming to look more cloudy and ambiguous, and so is his exact contribution to
western culture.
The chief ancient sources of our information concerning the Ionians are
Herodotus, Pausanias and Strabo.
P. 14. Thuc. I. 2. Thuc. I. 6. Herod. I. 57.
P. 15. See especially D. G. Hogarth, Ionia and the East (1909).
J. Burnet, Who was Javan? in Proceedings of the Class. Assoc. of Scot.
1911-12. Herod. I. 142.
P. 16. Herod. I. 171 f.
P. 17. An authoritative little book dealing with (among other peoples) the
Anatolian races is D. G. Hogarth’s The Ancient East (Home Univ.
Ser.), 1914. Also H. R. Hall, The Ancient History of the Near East
(1913).
P. 18. V. Bérard, Les Phéniciens et l’Odyssée is full of instruction on the ways of
the ancient mariner.
For the Colchians, see Hippocrates de aer. aq. loc. 15. Cf. Herod. II. 104
f.
P. 19. Chalybes. Il. II. 857. Herod. I. 203.
P. 20. Herod. IV. 93 f. Olbia. Herod. IV. 18. Scythian bow. Plato, Laws, 795-.
P. 21. Herod. IV. 18 f.
P. 22. Herod. IV. 172 f.
P. 25. Herod. II. 152. Abusimbel inscr. in Hicks and Hill’s Manual.
P. 26 f. Fragments of Archilochus in Bergk’s Poet. Lyr. Gr.

KEEPING THE PASS


The Battle of Thermopylae as related by Herodotus (practically our sole authority)
is an epic. Therefore in telling it again I have frankly attempted an epical manner
as being really less misleading than any application of the historical method. This
is not to say that the narrative of Herodotus has not been greatly elucidated by
the research of modern historians, especially by the exciting discovery of the path
Anopaia by Mr. G. B. Grundy. I have followed his reconstruction of the battle
(which may not be very far from the truth) in his book, The Great Persian War
(1901). See also Mr. Macan’s commentary in his great edition of Herodotus.
P. 34. See Frazer’s note on Thermopylae in his edition of Pausanias.
P. 36. Cf. Xen. Anab. VII. 4, 4 (Thracians of Europe).
P. 39. Tiara. schol. Ar. Birds 487. The King’s tiara was also called kitaris.
P. 39. For Persian dress cf. with Herod. Strabo 734. Xen. Cyrop. VII. 1, 2. There
are also representations in ancient art, e.g. a frieze at Susa.

THE ADVENTURERS

P. 45. Strabo IV.


P. 46. Herod. IV. 44.
P. 47. The Greek Tradition (1915), Allen and Unwin, p. 6f.
P. 48. Herod. IV. 151-153.
P. 50. For an account of the Oasis at Siwah, see A. B. Cook, Zeus, vol. I.
P. 51. Hymn ad Apoll. 391 f.
P. 52. Pind. Ol. 3 ad fin.
P. 53. Herod. VI. 11, 12, 17. Cf. Strabo on foundation of Marseille, IV (from
Aristotle).
P. 54. Herod. III. 125, 129-137 (Demokêdês).
P. 55. Polycrates. Herod. II. 182 and III passim.
P. 61 Xen. Anab. I-IV.
f.61 f.
P. 63. Pisidians. Cf. Xen. Memor. V. 2, 6.
P. 67. L’Anabase de Xenophon avec un commentaire historique et militaire, by
Col. (General) Arthur Boucher, Paris, 1913.
P. 69. There is a fine imaginative picture of Nineveh in the Book of Jonah.
P. 71. The famous Moltke was nearly drowned from a “tellek.”
P. 77. The hot spring may be the sulphurous waters of Murad, which have
wonderful iridescences.
The Armenian underground houses are still to be seen. These earth-
houses are found elsewhere—in Scotland, for instance. See J. E.
Harrison, in Essays and Studies presented to W. Ridgeway, p. 136 f.

ELEUTHERIA

P. 82. Aesch. Pers. 241 f. Herod. VII. 104.


P. 83. Pers. 402 f. Eur. Helen 276.
P. 84. Thuc. I. 3, 3 (“Hellenes” and “Barbarians” correlative terms).
Herod. I. 136.
P. 85. Aeschines 3, 132. Letter to Gadatas, Dittenb. Syllog.2 2.
Herod. III. 31. Cf. Daniel VI. 37, 38. Ezekiel xxvi. 7.
P. 86. Herod. IX. 108-113.
P. 88. Cf. vengeance of Persians on Ionians, Herod. VI. 32.
Herod. VII. 135.
P. 89. Herod. VIII. 140 f.
P. 90 f. “The ancients were attached to their country by three things—their
temples, their tombs, and their forefathers. The two great bonds
which united them to their government were the bonds of habit and
antiquity. With the moderns, hope and the love of novelty have
produced a total change. The ancients said our forefathers, we say
posterity; we do not, like them, love our patria, that is to say, the
country and the laws of our fathers, rather we love the laws and the
country of our children; the charm we are most sensible to is the
charm of the future, and not the charm of the past.” Joubert, transl.
by M. Arnold.
P. 92. See J. E. Harrison on Anodos Vases in her Prolegomena, p. 276 f.
Herod. VIII. 109. Herod. VIII. 65.
P. 96. Herod. IX. 27. Supplices 314 f. But see the whole speech of Aithra, and
indeed the whole play, which is full of the mission of Athens as the
champion of Hellenism. Cf. also Eur. Heraclid. G. Murray, Introduction
to trans. of Eur. Hippol. etc., on “Significance of Bacchae” (1902).
P. 97. Thuc. I. 70, 9. Herod. VII. 139. Dem. de Cor. 199 f.
P. 98. Arist. Pol. 13172 40, agreeing with Plato Resp. 562B.
P. 99. Plato Resp. 563c. Herod. III. 80.
Herod. V. 78. Cf. Hippocr. de aer. aq. loc. 23, 24. Both agree that a high
spirit may be produced by suitable nomoi and that man’s spirits are
“enslaved” under autocracy. This is a more liberal doctrine than that
discussed in Aristotle, that Barbarians are slaves “by nature.”
P. 100. Supplices 403 f. Medea 536 f.
The association of Liberty and Law is exhibited both positively and
negatively (as in the breach of both by the tyrant) in the tragic
poets, etc. Thus the Suppliants of Aeschylus is concerned with a
point of marriage-law, the Antigone of Sophocles with a point of
burial-law, and so on.
Another “romantic” hero is Cadmus.
P. 104. Hom. Il. VI. 447 f.

SOPHROSYNE

P. 110. Plato Resp. 329B. ib. 439E.


P. 111. Plato Resp. 615c. Xen. Hellen. VI. 4, 37.
P. 112. Plut. Pelop. 29. Herod. III. 50; V. 92.
P. 120. Herod. VIII. 26.
P. 121. Purg. XXIV. 137-8.

GODS AND TITANS

P. 122. Od. III. 48.


P. 123 I may allow myself to refer, for more detailed evidence, to my article The
f. Religious Background of the “Prometheus Vinctus” in Harvard
Studies in Class. Philol. vol. XXXI, 1920. Cf. Prof. G. Murray in
Anthropology and the Classics, ed. R. R. Marett.
P. 124. Theog. 126 f. Theog. 147 f. “ill to name,” οὐκ ὀνομαστοί. I think the
meaning may be that to mention their names was dangerous—
especially if you got them wrong. Cf. Aesch. Ag. 170. The Romans
provided against this danger by the indigitamenta.
P. 126. Theog. 453 f.
P. 128. Theog. 617 f. Theog. 503 f.
P. 129. Solmsen, Indog. Forsch. 1912, XXX, 35 n. 1. Theog. 886 f. Theog. 929h f.
P. 130. Heracl. fr. 42 (Diels). Xenophan. fr. 11.
Pind. Ol. I. 53 f.
P. 136. On the “anarchic life,” see Plato Laws 693-699. Democritus (139) says,
“Law aims at the amelioration of human life and is capable of this,
when men are themselves disposed to accept it; for law reveals to
every man who obeys it his special capacity for excellence.”
Zeus, acc. to Plato Crit. sub fin. is a constitutional ruler.
P. 137. Herod. I. 34 f.
CLASSICAL AND ROMANTIC

P. 147. Plut. Alex. I.


P. 150. Il. II. 459 f. Il. IV. 452 f. Il. XIX. 375 f.
Od. XIX. 431 f. Od. XIX. 518 f.
P. 151. Il. VI. 418 f. Il. XIV. 16 f. Il. XXIV. 614 f.
P. 152. Il. XIV. 347 f. Od. XI. 238 f.
P. 153. Pind. Ol. I. 74 f. Ol. VI. 53.
P. 155. Il. XXIII. 597 f.
P. 161 See my Studies in the Odyssey, Oxford, 1914.
f.
P. 163. Il. III. 243 f. Il. XVI. 453 f. Od. XIX. 36 f.
P. 164. Od. XX. 351 f. ad Cererem 5 f. ad Dion. 24 f.

II

P. 168. Thuc. III. 38. ζητοῦντές τε ἄλλο τι ὡς εἰπεῖν ἢ ἐν οἷς ζῶμεν.


On Elpis, see F. M. Cornford in Thucydides Mythistoricus, ch. IX, XII, XIII.
P. 172. Od. XI. 235 f. Plato Resp. 573B.
P. 175. See Prof. Burnet, Greek Philosophy (1914), Part I, p. 146 f.
P. 182. Il. XVIII. 205 f.
P. 183. Il. XII. 378 f.
P. 184. J. M. Synge said, “It may almost be said that before verse can be human
again it must learn to be brutal.” But this merely shows how much
we are suffering from a reaction against sentimental romanticism.

III

P. 189. Il. XIII. 444. Il. XIII. 616 f. Il. XIV. 493 f. Il. XVI. 345 f. Il. XX. 416 f.
P. 190. Il. XVI. 751 f.
P. 191. Arist. Nic. Eth. III. 6, 6. Plato Apol. ad fin.
Od. XI. 488 f. Od.. XI. 72 f. Note the effect of the καί before ζωός. It is
“simple pathos” if you like, hardly self-conscious enough to be called
“wistful.” There are some wonderful touches of it in Dante’s Inferno.
P. 192. Phrasikleia. Kaibel, Epigr. Sepulchr. Attic. 6.
P. 193. The Eretrian epigram is preserved in the Palatine Anthology.
P. 195. Ag. 1391 f.
P. 196. Ant. 571 f.
INDEX
Abu Simbel, 25
Achilles, 181 f., 191
Adrastos, 138, 140 f.
Adriatic, 24
Aegean peoples and culture, 14 f., 123
Aegina, 55
Aegisthus, 194 f.
Aeneas, 183
Aeschines, 81
Aeschylus, 58, 82, 83, 130 f., 153, 156, 170, 194 f., 200, 201 f.
Africa, 22 f., 23, 35, 48 f.
Agamemnon, 156, 194 f.
Agon, 118 f., 148
Ahuramazda, 39, 85, 87
Aias, 183
Aithra, 96 f.
Alexander (the Great), 16, 45, 61, 102, 147, 169;
(of Macedon I), 89;
(of Pherae), 111 f.

Alkinoos, Narrative to, 159 f.


Alkman, 153
Alyattes, 30, 117
Amazons, 136
Amestris, 86
Amphiktyones, 34
Anaximander, 30
Anopaia, 42
Antigone, 196 f.
Apollonios, of Rhodes, 172
Arabian Nights, 160
Araxes, 79
“Archical Man,” The, 61, 62, 67
Archilochus, 26 f., 54, 172
Arganthonios, 52
Aristophanes, 162, 174, 186
Aristotle, 98, 110, 121, 147, 190 f.
Armenia, 64, 75 f.
Arnold, M., 52, 149 f., 176 f., 186
Artaxerxes II, 62, 63, 87 f.
Artaynte, 86
Artemision, 37
Asceticism, Greek, 110 f.
Asia Minor (Anatolia), 13 f., 23, 24, 46, 123
Asôpos, 33, 41;
(Gorge of), 33, 41

Assyria, 65, 69
Assyrians, 17
Atarantes, 23
Athena, 90 f., 129, 136, 159, 162
Athenians, 13, 14, 21, 31, 37, 55, 89 f., 95 f., 131, 168, 174 f.
Atlantes, 23
Atlantic, 52
Atlas, 23
Atossa, 58
Attica, 92, 93
Atys-Attis, 137 f.
Autochthones, 14, 92
Autonomy, 98

Babylon, 65, 88
Bacchae, 20
Beauty, 137
Belloc, H., 103 f.
Bitlis Tchai, 75
“Black-Cloaks,” 22
Black Sea, 18, 19, 23, 24, 79, 198
Blake, 173
Bomba, 50
Bosphorus, 18, 19
Boucher, 67
Boudinoi, 22
Boulis, 88
Briareos, 124, 128
“Bronze Men,” 25
Burnet, 193
Byron, 169

Carians, 16, 17, 24, 25, 28, 46


Catullus, 139
Caucasus, 19
Cecrops, 81
Celtic Literature, 149 f.
Chalybes, 19, 80
“Champion’s Light,” 180 f.
Cheirisophos, 70 f.
Chesterton, G. K., 103 f.
Chios, 52
Chorus, 201 f.
Cimmerians, 29
Circe, 159
Civilization, 102 f., 105 f.
“Classical,” 147 f.
Cleopatra, 171
Clytaemnestra, 194 f.
Colchians, 18, 36, 79, 198
Coleridge, 152, 153
Colonies, 24 f., 31, 47 f.
Corcyra, 116 f.
Corinth, 112 f., 168
Corinthian Gulf, 13
Corsica, 53
Cretans, 46 f., 69
Crete, 15, 16, 46 f., 122, 123, 126
Crimea, 20, 21, 29
Croesus, 30, 137 f.
Cuchulain, 179 f.
Culture Hero, 101 f.
Cyclops, 160
Cypria, 178
Cyrene, 48, 50 f.
Cyrus (the Great), 30, 36, 52, 58;
(the Younger), 62 f.

Dante, 121
Danube, 19, 20
Daphnis, 171
Dardanelles, 18, 24
Darius, 46, 54, 56 f., 85, 193
Dead, Worship of, 91 f., 113 f.
Delphi, 41, 50 f.
Demaratos, 82 f., 93
Democracy, 98 f.
Demokêdês, 54 f.
Demosthenes, 52, 97
Dikaios, 92 f.
Dionysius, 53 f.
Dionysus, 20
Dorians, 13, 14, 15, 17, 24, 37, 174 f.
Dryden, 171, 185

Earth-houses, 77 f.
Egypt, 25, 49
Egyptians, 18, 24, 25, 36, 56 f.
Eighteenth century, 185
Elea, 53
Eleusis, 93, 96
Eleutheria, 52 f.
Elpênor, 191 f.
Erechtheus, 91 f.
Eretria, 193
Eros, 172
Esther, 86
Etruria, 24
Euboea, 37 f., 193
Euêmeros, 122
Euphrates, 63
Euripides, 20, 96, 100, 101, 112, 138, 153, 173, 179, 198 f.
Exaggeration (hyperbole), 179 f.

Ferdiad, 181
Fire, Theft of, 131
Frazer, 138
Frigidity, 176

Gadatas, Letter to, 85


Garamantes, 22, 23
Gê (Gaia, Earth), 92, 124 f., 138
Germans, 149
Getai, 19
Gindânes, 23
Gods, 122 f.
Gyes, 124, 128
Gyges, 29 f.
Gymnosophists, 147

Haimon, 196
Harpagos, 52
Hector, 181 f.
Hecuba, 112
Helen, 163, 170, 182
Hephaistos, 200
Heracles, 100 f., 136;
(children of), 96

Heraclitus, 130
Hermesianax, 172
Herodotus, 14, 15, 20 f., 25, 48, 51, 54 f., 82, 86 f., 99, 112, 138 f.
Hesiod, 124 f., 156, 168, 177 f.
Hippias, 101
Hippokratês, 54
Hippolytus, 199
Hittites, 17, 123
Homer, 15, 20, 26, 109, 122, 124, 129 f., 140 f., 155, 158 f., 172, 189 f.
Hope, 168
Hydarnes, 41 f., 88 f.

“Immortals,” The, 38, 40 f.


India, 46, 147
Indians, 34, 36, 46
Iokasta, 196
Ionia, 13 f.
Ionians, 13 f., 37, 46 f., 53, 130, 174
Irish, 179 f.
Ismênê, 196 f.
Isonomy, 98 f.
Issêdones, 22
Itanos, 48 f.

Jason, 100, 198 f.


Julius Caesar (in Shakespeare), 194
Kalevala, 160, 165 f.
Kallidromos, 33, 34
Kardouchians, 72 f.
Keats, 137, 151, 152, 154, 155, 185 f.
Kebriones, 190
Kentrîtês, 75
Keraunos, 128 f.
King (the Great), 85 f.;
(Old and New), 123 f.

Kissians, 34, 36, 38 f.


Klearchos, 63 f.
Korôbios, 48 f.
Kottos, 124, 128
Kratos, 131
Kreon, 196 f.
Kronos, 123, 124 f.
Kroton, 54, 59 f.
Ktesias, 87
Kunaxa, 63
Kurdistan, 71
Kypselos, 112 f.

Ladê, 53
Landor, 185
Lang, A., 161
Law, 83 f., 100, 130 f.
Leaf, W., 159
Leonidas, 37, 39 f., 42, 44
Leontios, 110
Longfellow, 105
Lönnrot, 165
Love, 171 f., 199
Lycians, 17, 37, 163
Lydians, 17, 29 f., 35, 140 f.
Lykophron, 114 f.

Mabinogion, 154, 176


Magic, 149 f.
Makai, 23
Malis, 32;
(Gulf of), 32, 38, 40

Marmara, Sea of, 18, 24


Marseille, 45
Martin, H., 168
Medea, 100, 171
Medes, 30, 32, 34, 36, 38 f.
Melissa, 113 f.
Mercenaries, 25, 28, 63
Meredith, 109
Mesopotamia, 24, 63
Metis, 129, 198 f.
Midas, 29, 140
Miletus, 18, 24, 30, 47, 112
Milton, 169, 184
“Minoan” Culture, 47, 50
Minos, 16, 55
Mountain-Mother, 138 f.
“Mycenaean” Culture, 15, 24, 47
Mysians, 17, 35, 142
Mythology (Greek), 137, 155 f., 171 f.

Nana, 138 f.
Napoleon, 20, 67
Nasamônes, 22
Neoboule, 27
Neuroi, 21
Nikê, 119 f.
Nineveh, 69, 88
Nomads, 21, 22, 23
Nomos, 83 f., 135 f.
Odysseus, 156, 159 f., 163, 191
Oeta, 33, 40
Olbia, 20
Olympians, 129, 133, 135
Olympic Victor, 120
Olympus (Thessalian), 33, 129;
(Mysian), 138, 142, 144

Oroitês, 56
Otanes, 99
Ouranos, 124 f.

Paktôlos, 138, 140


Paros, 26, 27
Parthian Tactics, 68
Parysatis, 62, 65, 87
Patriotism (Greek), 94 f.
Pausanias, 156 f.
Periandros, 112 f.
Persephone, 164
Persians, 16, 30, 32 f., 34, 59 f.
Phaedra, 199
Phasis, 18, 79
“Philanthropy,” 96
Phocians, 37, 42, 52 f.
Phoenicians, 24, 36, 52
Phokaia, 24, 47, 53
Phrasikleia, 192
Phrygians, 17, 18, 29, 35, 123, 138 f.
Pindar, 52, 130, 153
Pindarism, 169
Pirates, 24
Pisidians, 63
Platea, 48 f.
Plato, 98, 110, 117, 130, 137, 162, 172, 175, 193 f.
Plutarch, 82, 87, 99, 111, 147
Polykratês, 55 f.
Polyneikes, 197 f.
Prokles, 114 f.
Prometheia, 130 f.
Prometheus, 102, 131 f., 200
Proxenos, 62 f.
Psammetichos, 24 f.
Pytheas, 45

Queen-Consort, 123 f.

Realism, 160, 186, 187 f.


Renaissance, 184
Restoration, 185
Rhea, 123, 124, 126, 138
Rhodians, 68 f., 71
“Romantic,” 100 f., 107 f., 147 f.
Rossetti, 152, 166
Ruskin, 112, 163
Russia, 19

Salamis, 83, 92
Salmoxis, 19
Samians, 49 f., 55, 117
Sappho, 152, 153, 172, 185, 200
Sardis, 56, 62, 63, 86, 138, 140 f.
Scotland, 45
Scott, 61, 62
Scythians, 20 f.
Shakespeare, 111, 151, 154, 184, 190, 194
Shaw, 148, 199
Shelley, 133
Simonides, 192 f.
Sirens, 160
Skylax, 46
Socrates, 62, 67, 175, 191
Sophocles, 110, 173, 196 f.
Sophrosyne, 105 f., 135, 172
Sosikles, 112 f.
Spain, 24
Spartans, 34 f., 37 f., 83, 88 f., 175, 193
Sperthias, 88 f.
Stone (Omphalos), 127
Strabo, 45
Susa, 56 f., 60, 86, 88
Symbolism, 190 f.

Táin Bó Cúalnge, 179


Tarentum, 59
Tartessos, 49, 51
Tauri, 21
Telemachus, 163
Tellek, 71
Tennyson, 186
Thales, 30
Thasos, 27 f.
Thebans, 37, 43, 96 f.
Themistocles, 92
Theogony, 124, 128
Theophrastus, 120
Thera, 48 f.
Thermopylae, 33 f., 193
Theseus, 91, 96 f., 99, 100 f., 136
Thespians, 37, 43
Thessaly, 32
Thracians, 18, 19 f., 36
Thrasyboulos, 112 f.
Thucydides, 14
Tiara, 39
Tigris, 64, 65, 70 f.
Tiribazos, 75 f.
Tissaphernes, 65 f.
Titanism, 167 f.
Titans, 122 f.
Tragedy, Attic, 139 f., 194 f.
Trebizond, 79
Trinity (Primitive Religious), 123
Troglodytes, 23
Trojans, 182
Tugdammi, 29 f.
Tyranny, 99, 111, 119

Victorianism, 186 f.
Virgil, 183

Wainamoinen, 102
Wells, H. G., 103, 120
Wordsworth, 185

Xenophanês, 130
Xenophon, 61 f.
Xerxes, 33 f., 83, 85, 86 f., 89, 93, 97

Yeats, W. B., 158

Zab, 66 f.
Zacho Dagh, 70 f.
Zeus, 122, 123, 126 f., 128 f., 145, 157, 163
Printed in Great Britain by
UNWIN BROTHERS, LIMITED, THE GRESHAM PRESS, WOKING AND LONDON

*** END OF THE PROJECT GUTENBERG EBOOK GREEKS &


BARBARIANS ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like