100% found this document useful (1 vote)
9 views

Building Java Programs A Back to Basics Approach 60593rd Edition Stuart Reges instant download

The document is a PDF download link for the book 'Building Java Programs: A Back to Basics Approach' by Stuart Reges and Marty Stepp, which covers fundamental concepts of Java programming. It includes a detailed table of contents outlining various programming topics such as data types, loops, object-oriented programming, and graphical user interfaces. The book is designed for beginners and provides a structured approach to learning Java programming.

Uploaded by

nagimschizo
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
9 views

Building Java Programs A Back to Basics Approach 60593rd Edition Stuart Reges instant download

The document is a PDF download link for the book 'Building Java Programs: A Back to Basics Approach' by Stuart Reges and Marty Stepp, which covers fundamental concepts of Java programming. It includes a detailed table of contents outlining various programming topics such as data types, loops, object-oriented programming, and graphical user interfaces. The book is designed for beginners and provides a structured approach to learning Java programming.

Uploaded by

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

Building Java Programs A Back to Basics Approach

60593rd Edition Stuart Reges pdf download

https://ebookfinal.com/download/building-java-programs-a-back-to-
basics-approach-60593rd-edition-stuart-reges/

Explore and download more ebooks or textbooks


at ebookfinal.com
We have selected some products that you may be interested in
Click the link to download now or visit ebookfinal.com
for more options!.

Back to Basics Tactics Dan Heisman

https://ebookfinal.com/download/back-to-basics-tactics-dan-heisman/

The Everything Guide to Living Off the Grid A back to


basics manual for independent living Terri Reid

https://ebookfinal.com/download/the-everything-guide-to-living-off-
the-grid-a-back-to-basics-manual-for-independent-living-terri-reid/

The Essentials of Trading From the Basics to Building a


Winning Strategy 1st Edition John Forman

https://ebookfinal.com/download/the-essentials-of-trading-from-the-
basics-to-building-a-winning-strategy-1st-edition-john-forman/

Building Strategic Language Ability Programs 1st Edition


Joshua R. Weston

https://ebookfinal.com/download/building-strategic-language-ability-
programs-1st-edition-joshua-r-weston/
Nursing Assistant A Nursing Process Approach Basics 1st
Edition Barbara Hegner

https://ebookfinal.com/download/nursing-assistant-a-nursing-process-
approach-basics-1st-edition-barbara-hegner/

Low Back Disorders Evidence Based Prevention and


Rehabilitation 1st Edition Stuart Mcgill

https://ebookfinal.com/download/low-back-disorders-evidence-based-
prevention-and-rehabilitation-1st-edition-stuart-mcgill/

Low Back Disorders Evidence Based Prevention and


Rehabilitation 3rd Edition Stuart Mcgill

https://ebookfinal.com/download/low-back-disorders-evidence-based-
prevention-and-rehabilitation-3rd-edition-stuart-mcgill/

Mediated Modeling A System Dynamics Approach To


Environmental Consensus Building 1st Edition Marjan Van
Den Belt
https://ebookfinal.com/download/mediated-modeling-a-system-dynamics-
approach-to-environmental-consensus-building-1st-edition-marjan-van-
den-belt/

Java EE 7 Recipes A Problem Solution Approach 1st Edition


Josh Juneau (Auth.)

https://ebookfinal.com/download/java-ee-7-recipes-a-problem-solution-
approach-1st-edition-josh-juneau-auth/
Building Java Programs A Back to Basics Approach
60593rd Edition Stuart Reges Digital Instant Download
Author(s): Stuart Reges, Marty Stepp
ISBN(s): 9780321382832, 0321382838
Edition: 60593rd
File Details: PDF, 6.68 MB
Year: 2007
Language: english
Building Java Programs
Stuart Reges and Marty Stepp

1
2
Table of Contents
Chapter 1: Introduction to Java Programming
1.1 Basic Computing Concepts
Why Programming?
Hardware and Software
The Digital Realm
Why Java?
The Process of Programming
The Java Programming Environment
1.2 And Now--Java
String Literals (Strings)
System.out.println
Escape Sequences
Identifiers and Keywords
Comments and Readability
A Complex Example: DrawFigures1
1.3 Program Errors
Syntax Errors
Logic Errors (bugs)
1.4 Procedural Decomposition
Static Methods
Flow of Control
Methods That Call Other Methods
An Example Runtime Error
1.5 Case Study: DrawFigures
Structured Version
Final Version without Redundancy
Analysis of Flow of Execution

Chapter 2: Primitive Data and Definite Loops

2.1 Basic Data Concepts


Primitive Types
Expressions
Literals
Arithmetic Operators
Precedence
Mixing Types and Casting
2.2 Variables
Assignment/Declaration Variations
String Concatenation
Increment/Decrement Operators
Variables and Mixing Types
2.3 The for Loop
Tracing for Loops
3
print Versus println
Nested for Loops
2.4 Managing Complexity
Scope
Pseudocode
A Decrementing for Loop
Class Constants
2.5 Case Study: A Complex Figure
Problem Decomposition and Pseudocode
Line Pattern Table
Initial Structured Version
Adding a Class Constant
Further Variations

Chapter 3: Introduction to Parameters and Objects


3.1 Parameters
The Mechanics of Parameters
Limitations of Parameters
Multiple Parameters
Parameters Versus Constants
Overloading of Methods
3.2 Methods that Return Values
The Math Class
Defining Methods that Return Values
3.3 Using Objects
String Objects
Point Objects
Reference Semantics
Multiple Objects
Objects as Parameters to Methods
3.4 Interactive Programs
Scanner Objects
A Sample Interactive Program
3.5 Case Study: Projectile Trajectory
An Unstructured Solution
A Structured Solution

Supplement 3G: Graphics (optional)


3G.1 Introduction to Graphics
DrawingPanel
Lines and Shapes
Colors
Text and Fonts
3G.2 Procedural Decomposition with Graphics
A Larger Example: DrawDiamonds
Summary of Graphics Methods
4
3G.3 Case Study: Pyramids
An Unstructured Solution
Generalizing the Drawing of Pyramids
A Complete Structured Solution

Chapter 4: Conditional Execution


4.1 Loop Techniques
Cumulative Sum
Fencepost Loops (aka "loop and a half")
4.2 if/else Statements
Relational Operators
Cumulative Sum with if
Fencepost with if
Nested if/else
4.3 Subtleties of Conditional Execution
Object Equality
Roundoff Errors
Factoring if/else Statements
Min/Max Loops
4.4 Text Processing
The char Type
System.out.printf
4.5 Methods with Conditional Execution
Preconditions and Postconditions
Throwing Exceptions
Revisiting Return Values
4.6 Case Study: Body Mass Index (BMI)
One-person Unstructured Solution
Two-person Unstructured Solution
Two-person Structured Solution

Chapter 5: Program Logic and Indefinite Loops


5.1 The while Loop
A Loop to Find the Smallest Divisor
Sentinel Loops
Random Numbers
5.2 The boolean Type
Logical Operators
Short-Circuited Evaluation
boolean Variables and Flags
Boolean Zen
5.3 User Errors
Scanner Lookahead
Handling User Errors
5.4 Indefinite Loop Variations
The do/while Loop
5
Break and "forever" Loops
5.5 Assertions and Program Logic
Reasoning About Assertions
A Detailed Assertions Example
The Java assert Statement
5.6 Case Study: NumberGuess
Initial Version without Hinting
Randomized Version with Hinting
Final Robust Version

Chapter 6: File Processing


6.1 File Reading Basics
Data, Data Everywhere
File Basics
Reading a File with a Scanner
6.2 Details of Token-Based Processing
Structure of Files and Consuming Input
Scanner Parameters
Paths and Directories
A More Complex Input File
6.3 Line-Based Processing
String Scanners and Line/Token Combinations
6.4 Advanced File Processing
Output Files with PrintStream
Try/Catch Statements
6.5 Case Study: Weighted GPA

Chapter 7: Arrays
7.1 Array Basics
Constructing and Accessing an Array
A Useful Application of Arrays
Random Access
Arrays and Methods
The For-Each Loop
Limitations of Arrays
7.2 Advanced Arrays
Shifting Values in an Array
Initializing Arrays
Arrays in the Java Class Libraries
Arrays of Objects
Command Line Arguments
7.3 Multidimensional Arrays (optional)
Rectangular Two-Dimensional Arrays
Jagged Arrays
7.4 Case Study: Hours Worked
The transferFrom Method
6
The sum Method
The addTo Method
The print Method
The Complete Program

Chapter 8: Defining Classes


8.1 Object-Oriented Programming Concepts
Classes and Objects
8.2 Object State: Fields
8.3 Object Behavior: Methods
A Detailed Example
Mutators and Accessors
8.4 Object Initialization: Constructors
8.5 Encapsulation
Private Data Fields
Class Invariants
8.6 More Instance Methods
The toString Method
The equals Method
8.7 The this Keyword
Multiple Constructors
8.8 Case Study: Designing a Stock Class
Stock Behavior
Stock Fields
Stock Constructor
Stock Method Implementation
The Complete Stock Class

Chapter 9: Inheritance and Interfaces


9.1 Inheritance Concepts
Non-programming Hierarchies
9.2 Programming with Inheritance
Overriding Methods
Polymorphism
9.3 The Mechanics of Polymorphism
Diagramming Polymorphic Code
9.4 Interacting with the Superclass
Inherited Fields
Calling a Superclass's Constructor
Calling Overridden Methods
A Larger Example: Point3D
9.5 Inheritance in the Java Class Libraries
Graphics2D (optional)
Input/Output Streams
9.6 Interfaces
An Interface for Shape Classes
7
Implementing the Shape Interface
Benefits of Interfaces
Interfaces in the Java Class Libraries
9.7 Case Study: Designing a Hierarchy of Financial Classes
Class Design
Initial Redundant Implementation
Abstract Classes

Chapter 10: ArrayLists


10.1 ArrayLists
Basic ArrayList Operations
ArrayList Searching Methods
Sample ArrayList Problems
The for-each Loop
Wrapper Classes
10.2 The Comparable Interface
Natural Ordering and compareTo
Implementing Comparable
10.3 Case Study: Vocabulary Comparison
Version 1: Compute Vocabulary
Version 2: Compute Overlap
Version 3: Complete Program

Chapter 11: Java Collections Framework


11.1 Lists
Collections
LinkedList versus ArrayList
Iterators
LinkedList Example: Sieve
Abstract Data Types (ADTs)
11.2 Sets
Set Concepts
TreeSet versus HashSet
Set Operations
Set Example: Lottery
11.3 Maps
Basic Map Operations
Map Views (keySet and values)
TreeMap versus HashMap
Map Example: WordCount
Collection Overview

Chapter 12: Recursion

12.1 Thinking Recursively

8
A Nonprogramming Example
An Iterative Solution Converted to Recursion
Structure of Recursive Solutions
12.2 A Better Example of Recursion
Mechanics of Recursion
12.3 Recursive Functions
Integer Exponentiation
Greatest Common Divisor
12.4 Recursive Graphics (optional)
12.5 Case Study: Prefix Evaluator
Infix, Prefix and Postfix Notation
Prefix Evaluator
Complete Program

Chapter 13: Searching and Sorting


13.1 Searching and Sorting in the Java Class Libraries
Binary Search
Sorting
Shuffling
Custom Ordering with Comparators
13.2 Program Efficiency
Algorithm Runtimes
Complexity Classes
13.3 Implementing Searching Algorithms
Sequential Search
Binary Search
Searching Objects
13.4 Implementing Sorting Algorithms
Selection Sort
Merge Sort
Other Sorting Algorithms

Chapter 14: Graphical User Interfaces


14.1 Graphical Input and Output with JOptionPane
14.2 Graphical Components
Working with JFrames
Common Components: Buttons, Labels, and Text Fields
JTextArea, JScrollPane, and Font
Icons
14.3 Laying Out Components in a Frame
Layout Managers
SpringLayout
Composite Layout
14.4 Events
Action Events and ActionListener
More Sophisticated ActionEvents
9
A Larger GUI Example with Events: Credit Card GUI
Mouse Events
14.5 2D Graphics
Drawing Onto Panels
Simple Animation with Timers
14.6 Case Study: Demystifying DrawingPanel

Appendix A: Answers to Self-Check Problems

10
Chapter 1
Introduction to Java Programming
Copyright © 2006 by Stuart Reges and Marty Stepp

1.1 Basic Computing Concepts 1.3 Program Errors


Hardware and Software Syntax Errors
The Digital Realm Logic Errors (bugs)
Why Programming? 1.4 Procedural Decomposition
Why Java? Static Methods
The Process of Programming Flow of Control
The Java Programming Environment Methods That Call Other Methods
1.2 And Now--Java An Example Runtime Error
String Literals (Strings) 1.5 Case Study: DrawFigures
System.out.println Structured Version
Escape Sequences Final Version without Redundancy
Identifiers and Keywords Analysis of Flow of Execution
Comments and Readability
A Complex Example: DrawFigures1

Introduction
In this chapter, we introduce some basic terminology about computers and programming. We
discuss the Java language and its programming environment. We take a brief look at writing simple
but structured Java programs that produce output.

11
1.1 Basic Computing Concepts
Computers are pervasive in our daily lives, giving us access to nearly limitless information. Some
of this information is essential news, like the headlines at cnn.com. Some of it is more frivolous: If
you're concerned about whether the guy you met last night cheats on his girlfriends, perhaps
you've visited dontdatehimgirl.com. Computers let us share photos with our families and map
directions to the nearest pizza place for dinner.

Lots of real-world problems are being solved by computers, some of which don't much resemble
the one on your desk or lap. The human genome is sequenced and searched for DNA patterns using
powerful computers. There are computers in recently manufactured cars, monitoring each vehicle's
status and motion. Digital music players such as Apple's iPod are actually computers underneath
their small casing. Even the Roomba vacuum cleaning robot houses a computer with complex
instructions about how to dodge furniture while cleaning your floors.

But what makes a computer a computer? Is a calculator a computer? Is a human being with a paper
and pencil a computer? The next several sections attempt to address this question while leading us
toward putting computers in our command through programming.

Hardware and Software


A computer is a machine that manipulates data and executes lists of instructions known as programs.

Program

A list of instructions to be carried out by a computer.

One key feature that differentiates a computer from a simpler machine like a calculator is its
versatility. The same computer can perform many different tasks (playing games, computing
income taxes, connecting to other computers around the world) depending on what program it is
running at a given moment. A computer can run not only the programs that exist on it currently but
also new programs that haven't even been written yet.

The physical components that make up a computer are collectively


called hardware. One of the most important pieces of hardware is the
central processing unit or CPU, which is the brain of the computer
that executes instructions. Also important is the computer's memory
(often called random access memory or RAM, because the computer
can access any part of that memory at any time). The computer uses
its memory to store programs that are being executed, along with
their data. RAM is limited in size and does not retain its contents
when the computer is turned off. Therefore, computers generally also use a hard disk as a larger
permanent storage area.

12
Computer programs are collectively called software. The primary piece of software running on a
computer is its operating system. An operating system provides an environment where many
application programs may be run at the same time, as well as providing a bridge between those
programs and the hardware and user. The programs that run inside the operating system are often
called applications.

When the user selects a program to be run by the operating system (such as by double-clicking the
icon of that program on the desktop), several things happen. The instructions for that program are
loaded into the computer's memory from the hard disk. The operating system allocates memory for
that program to use. The instructions of the program are fed from the memory to the CPU and
executed sequentially.

The Digital Realm


In the last section we saw that a computer is a general purpose device that can be programmed.
You will often hear people refer to modern computers as digital computers because of the way that
they operate.

Digital

Based on numbers that increase in discrete increments such as the integers (0, 1, 2, 3, etc).

Because computers are digital, everything that is stored on a computer is stored as a sequence of
integers. This includes every program and every piece of data. The idea of representing everything
as an integer was fairly unusual in the 1940's when the first computers were built. This idea seems
less unusual today now that we have digital music, digital pictures and digital movies. An mp3 file,
for example, is simply a long sequence of integers that stores audio information.

Not only are computers digital, storing all information as integers, they are also binary, which
means that those integers are stored as binary numbers.

Binary Number

A number composed of just 0's and 1's, also known as a base-2 number.

Humans generally work with decimal or base-10 numbers. It might seem odd that computers use
binary numbers when people are so used to base-10 numbers, but we use base-10 because it
matches our physiology (10 fingers and 10 toes). In the case of computers, we want a system that
will be easy to create and that will be very reliable. It turns out to be simpler to build a system on
top of binary phenomena (e.g., a circuit being open or closed) than to build it on a system with ten
different states to distinguish (e.g., 10 different voltage levels).

From a mathematical point of view, you can store things just as easily using binary numbers as you
can using base-10 numbers. Since it is easier to construct the physical device using binary numbers,
that's what computers use.

13
It does mean, however, that people who aren't used to computers often encounter unfamiliar
conventions. As a result, it is worth spending a little time reviewing how binary numbers work. In
binary you start with 0 and you can count up, just like you do in base-10, but you run out of digits
much faster. So counting in binary you say:
0
1

And already you've run out of digits. This is like reaching 9 when you count in base 10. After you
run out of digits, you carry over to the next digit. So the next two numbers are:
10
11

And again we have run out of digits. This is like reaching 99 in base 10. So again we carry into the
next digit to form the 3-digit number 100. In binary, whenever you see a series of ones as in 111111,
you know you're just one away from the digits all flipping to 0 with a 1 in front, in the same way
that in base-10 when you see a number like 999999, you know that you are one away from those
digits turning to 0 with a 1 in front. The following table shows how we would count up to the base-
10 number 16 using binary.
decimal binary decimal binary
----------------- -----------------
0 0
1 1 9 1001
2 10 10 1010
3 11 11 1011
4 100 12 1100
5 101 13 1101
6 110 14 1110
7 111 15 1111
8 1000 16 10000

There are several useful observations to make about binary numbers. Notice in the table above that
the binary numbers 1, 10, 100, 1000, 10000 are all perfect powers of 2 (20 , 21, 22, 23, 24 ). In the same
way that in base-10 we talk about a one's digit, ten's digit, hundred's digit and so on, we can think
in binary of a one's digit, two's digit, four's digit, eight's digit, sixteen's digit and so on.

Computer scientists quickly found themselves needing to refer to the sizes of different binary
quantities so we invented the term bit to refer to a single binary digit and the term byte to refer to 8
bits. To talk about large amounts of memory, we talk about kilobytes (KB), megabytes (MB),
gigabytes (GB) and so on. Many people think that these correspond to the metric system where
"kilo" means 1000, but that is only approximately true. We use the fact that 210 is appromixately
equal to 1000 (it actually equals 1024). So a kilobyte is 210 bytes (1024 bytes), a megabyte is 220 bytes
(1,048,576 bytes), a gigabyte is 230 bytes (1,073,741,824 bytes) and so on.

14
Why Programming?
At most universities the first course in computer science is predominantly a programming course.
Many computer scientists are bothered by this because it leaves people with the impression that
computer science = programming. While it is true that many trained computer scientists spend time
programming, there is a lot more to the discipline than just programming. So why do we study
programming first?

A Stanford computer scientist named Don Knuth answers this question by saying that the common
thread to most of computer science is that we all in some way work with algorithms.

Algorithm

A step-by-step description of how to accomplish a task.

Knuth is an expert in algorithms, so he would naturally be biased to think of them as the center of
computer science. He claims that what is most important is not the algorithms themselves, but
rather the thought process that computer scientists employ. Knuth has said:

It has often been said that a person does not really understand something until after teaching
it to someone else. Actually a person does not really understand something until after
teaching it to a computer, i.e., expressing it as an algorithm.

Knuth is describing a thought process that is common to most of computer science which he refers
to as algorithmic thinking. So we study programming not because it is the most important aspect of
computer science, but because it is the best way to explain the approach computer scientists take to
solving problems.

Algorithms are expressed as computer programs.

The Process of Programming


The word code describes program fragments ("these four lines of code") or the act of programming
("Let's code this into Java"). Once a program has been written, you can execute it.

Program Execution

The act of carrying out the instructions contained in a program.

The process of execution is often called running. It can be used as a verb, "When my program runs it
does something strange. . .," or as a noun, "The last run of my program produced these results. . ."

Computer programs are stored internally as a series of binary numbers known as the machine
language of the computer. In the early days programmers entered numbers like these directly into
the computer. Obviously this is a tedious and confusing way to program a computer and we have
invented all sorts of mechanisms to simplify this process.

15
Modern programmers write in what are known as high-level programming languages like Java.
Such programs cannot be run directly on a computer. They first have to be translated into a
different form by a special program known as a compiler.

Compiler

A program that translates a computer program written in one language into an equivalent
program in another language (often, but not always, translating into machine language).

A compiler that translates directly into machine language creates a program that can be executed
directly on the computer. We refer to such a program as an executable and we refer to such
compilers as native compilers because they compile code to the lowest possible level (the native
machine language of the computer).

This approach works well when you know exactly what computer you want your program to
execute on. But what if you want to execute a program on many different computers? Using this
approach you'd need a compiler that generates different machine language output for each
different computer. The designers of Java decided to use a different approach. They cared a lot
about being able to run on many different computers because they wanted to have a language that
worked well for the web. People who write applets (Java programs that live inside web pages) want
those programs to run on many different computers.

Instead of compiling into machine language, Java programs are compiled into what are known as
Java bytecodes. These bytecodes represent an intermediate level. They aren't quite as high-level as
Java but they also aren't quite as low-level as machine language. The key thing is that one set of
bytecodes can execute on many different machines. Java bytecodes are similar to machine language.
In fact, they are the machine language of a theoretical computer known as the Java Virtual Machine
or JVM.

Java Virtual Machine (JVM)

A theoretical computer whose machine language is the set of Java bytecodes.

This isn't an actual machine but it's similar to actual machines. By compiling down to this level,
there isn't as much work left to turn the Java bytecodes into actual machine instructions.

In the Java programming language, nothing can exist outside of what is called a class.

Class

A unit of code that is the basic building block of Java programs.

The notion of a class is much richer than this as we'll see when we get to Chapter 8, but for now all
we need to know is that each of our Java programs will be stored in a class.

To actually execute a Java class file, you need another program that will execute the Java bytecodes.
Such programs are known generically as Java runtimes and the standard environment distributed
by Sun is known as the Java Runtime Environment.
16
Java Runtime Environment (JRE)

A program that executes compiled Java class files.

Most people have a Java runtime on their computer even if they don't know about it. For example,
Apple's OS X includes a Java runtime and the standard Windows installer from Microsoft installs a
Java runtime.

Why Java?

When Sun Microsystems released Java in 1995, they published a document called a "white paper"
describing their new programming language. Perhaps the key sentence from that paper is the
following:

Java: A simple, object-oriented, network-savvy, interpreted, robust, secure, architecture


neutral, portable, high-performance, multithreaded, dynamic language.

This sentence covers many of the reasons we'll be using Java as our programming
language in this textbook. Java is reasonably simple for beginners to learn. Java
embraces object-oriented programming, a style of writing programs that has been
shown to be very successful for creating large and complex software.

Java also includes a large amount of pre-written software that programmers can
utilize to enhance their programs. Such off-the-shelf software components are often
called libraries. For example, if you wish to write a program that connects to a site on
the internet, Java contains a library to simplify the connection for you. Java contains libraries to
draw graphical user interfaces, retrieve data from databases, and perform complex mathematical
computations, among many other things. These libraries collectively are called the Java class
libraries.

Java Class Libraries

Java's collection of pre-existing code that provides solutions to common programming problems.

The richness of Java's class libraries are an extremely important factor in the rise of Java as a
popular language. As of version 1.5, the class libraries include over 3200 entries.

Another reason to use Java is that it has a vibrant programmer community. There is a large amount
of online documentation and tutorials available to help programmers learn new skills. Many of
these documents are written by Sun themselves, such as an extensive reference to Java's class
libraries called the API Specification (where "API" stands for Application Programming Interface).

Java is extremely platform-independent; unlike programs written in many other languages, the
same Java program can be executed on many different operating systems such as Windows, Linux,
and Macintosh.

17
Java is used extensively by programmers for both research and business applications. This means
that a large number of programming jobs exist in the marketplace today for skilled Java
programmers. A sample Google search for the phrase "Java jobs" returns 124,000,000 hits.

The Java Programming Environment


You must become familiar with your computer setup before you start programming. Each
computer provides a different environment for program development, but there are some common
elements that deserve comment. No matter what environment you use, you will follow the same
basic three steps:

1. type in a program as a Java class


2. compile the program file
3. run the compiled version of the program

The basic unit of storage on most computers is a file. Every file has a name. A file name ends with
an extension, which is the part of a file's name that follows the period. A file's extension indicates the
type of data contained in the file. For example, files with extension .doc are Microsoft Word
documents, and files with extension .mp3 are MP3 audio files.

You will create files whose contents are Java programs. Java program files must use the
extension .java. When you compile a Java program, the resulting Java bytecodes are stored in a file
with the same name and the extension .class.

Most Java programmers use what are known as Integrated Development Environments or IDEs
that provide an all-in-one environment for creating, editing, compiling and executing program files.
Some of the more popular choices for introductory computer science classes are Eclipse, DrJava,
BlueJ and TextPad. Your instructor will tell you what environment you should use.

For example, you might type in the following program file:


1 public class Hello {
2 public static void main(String[] args) {
3 System.out.println("Hello, world!");
4 }
5 }

Don't worry about the details of this program right now. We will explore that in the next section.

Once you have typed in a program file, you move to step 2 and compile it. The command to
compile will be different in each different development environment, but the process is the same.
You have to submit your class file to the compiler for translation (typical commands are "compile"
or "build"). There might be errors, in which case you'd have to go back to the editor and fix the
errors and try to compile again. We'll discuss errors in more detail later in this chapter.

Once you have successfully compiled your program, you are ready to move to step 3 by running
the program. Again, the command to do this will differ from one environment to the next, but the
process is similar (the typical command is "run").

18
The following diagram summarizes the steps we would follow in creating a program named
Hello.java:

The Hello.java program involves an onscreen window known as the console.

Console Window

A special text-only window in which Java programs interact with the user.

The console window is a classic way to interact with computers where the computer displays text
on the screen and sometimes waits for the user to type responses. This is known as console or
terminal interaction. The text typed by the computer in the console window is known as the output
of the program. Anything typed by the user is known as the console input.

To keep things simple, most of the sample programs in this book involve console interaction.
Keeping the interaction simple will allow us to focus our attention and effort on other aspects of
programming. For those who are interested, Chapter 10 describes how to write programs that use a
more modern kind of interface known as a Graphical User Interface or GUI.

19
1.2 And Now--Java
It's time to look at a complete Java program. It is a tradition in computer science that when you
describe a new programming language, you should start with a program that produces a single line
of output with the words, "Hello, world!" The hello world tradition has been broken by many
authors of Java books because the program turns out not to be as short and simple when written in
Java.

Here is our hello world program:


1 public class Hello {
2 public static void main(String[] args) {
3 System.out.println("Hello, world!");
4 }
5 }

This defines a class called Hello. Sun has established the convention that class names always begin
with a capital letter, which makes it easy to recognize that something is the name of a class. Java
requires that the class name and the file name match, so this would have to be stored in a file called
Hello.java. Fortunately, you don't have to understand all of the details of this program just yet. But
you do need to understand the basic structure.

Remember that the basic unit of code in Java is the class. Every program must be contained within a
Java class. The basic form of a Java class is as follows.

public class <name> {


<method>
<method>
...
<method>
}

The description above is known as a syntax template because it describes the basic form of a Java
construct. Java has rules that determine its legal syntax or grammar. Each time we see a new
element of Java, we'll begin by looking at its syntax template. By convention, we use the characters
less-than ("<") and greater-than (">") in a syntax template to indicate items that need to be filled in.
In this case the name of the class and the methods both need to be filled in. When we write "..." in a
list of elements, we're indicating that any number of those elements may be included.

The first line of the class is known as the class header. The word public in the header indicates that
this class is available to anyone to use. Notice that the program code in a class is enclosed in curly
brace characters. The curly brace characters are used in Java to group together related bits of code.

Grouping Characters

The curly brace characters { and } used in Java to group together related lines of code.

In this case, the curly braces are indicating that everything defined inside these braces is part of this
public class.

20
Discovering Diverse Content Through
Random Scribd Documents
cords and let the victim down.
“He fell in a helpless heap on the floor, all hope and courage
crushed out of him, and wept and sobbed like a child. If it had been
wife and child for whom he had suffered any one must have wept
with him.”
“It was wife and child and country to him,” Ethne murmured; “it
was the double glamour which bewildered him—the hideous curse of
Mammon and the fond dream of affection. But what of Miriam?”
“She knelt down beside him,” Marius said, “the noble Jewish
woman. She threw her arms around him and sustained him; she
took his poor wounded hands and held them to her heart; she
sobbed out every tender name she could; I understood them by the
tones, though the words were in their own Hebrew. There was
tender reverence in her every gesture, even more than affection;
and turning to me, she said, in a tone almost of triumph, ‘It is not
himself, it is his deadliest enemy they have slain. And now he will be
himself again.’ And she added, ‘Thy wife will understand!’”
“I do understand,” Ethne said, with a victorious radiance like a
halo on her face; “and I have found him his true gold! I have found
his child! The idol is broken, but the dream of love shall prove true.”
The next morning she crept quietly into the chamber where they
had left Eleazar and Miriam. The old man had fallen at last into a
heavy sleep. Miriam was sitting on the floor beside him, holding one
of his hands. Ethne sat down beside her, and for some minutes said
nothing.
“The evil spirit has gone out of him,” Miriam said. “You see, he
sleeps as sweetly as a child.”
“And the lost child is coming to him,” Ethne answered. “Coming to
you both, mother and father! Your Rachel is found.”
Miriam started as if she had seen a spirit, fixing her dark eyes with
passionate intensity on the sweet grey eyes of Ethne. Her whole
frame quivered.
“Lady! child!” she said. “To thee, I know, it would be impossible to
lie, even in the fond hope of binding up a broken heart. You would
always know that nothing but truth could heal the wounded spirit, or
bind up the broken heart. Nothing but the love which is true—
nothing but God.”
“Nothing but God, Who is Truth and Love,” Ethne said, with her
infectious smile; “Who has heard thy prayers and seen thy tears all
through these weary years; Who gave thee compassion which made
thee good as an angel to me. He has led me to thy child.”
And then she told Miriam the story of Rachel.
As early as possible on the morrow Ethne and Marius went to the
farm on the mountains, and there they found Rachel amongst her
children; the dark-eyed boys, and one fair, golden-haired baby girl.
Father, mother, and children at once came down the hills to the villa
of Fabricius. There, by many tokens, the mother recognized her
child, whilst by an instinctive sympathy their hearts drew together.
When Eleazar awoke, the little group around him, Rachel and her
sons, and the golden-haired babe on Miriam the grandmother’s
knee, were beside him.
“Who are these?” he said, starting up, with eyes wide open and
bewildered, yet with a dawning consciousness in them, like one
waking out of a dream.
“It is only thy Rachel, our Rachel, and her children,” Miriam said,
in tender, quiet tones, caressing the little one on her knee. “Thou
hast always known they would come, and now, see, they are here!”
“Is it Paradise?” he said. “Are we in the garden of God?”
“Nay, beloved,” Miriam replied, very quietly, “except as every true
marriage brings us back to Eden.”
Then he began gradually to return to full, quiet consciousness,
and rising on the couch, he said—
“My Rachel! And all the dowry, all the treasure I had saved for
thee is gone.” Then burying his face in his hands, the old man wept,
quiet, natural tears.
But his daughter knelt beside him, and gently drawing down his
hands, laid her babe in his arms.
“Father,” she said, “see, the God of our fathers has given us the
gift and inheritance that cometh of the Lord.”
And her husband, standing behind her, laid his hand on her head
and said—
“See, here is thy hid treasure. Truly thou hast given the best jewel
in the world to me.”
“What to us were gold and silver?” Rachel pleaded. “God has
given us the babes, and also the old riches of our race, the riches of
Abraham our father. We are rich in flocks and herds. Wilt thou not
come and see?”
And the old man laid his trembling hands on her head, and said—
“The Lord hath taken away, and the Lord hath given; blessed be
the name of the Lord.”
CHAPTER XXIX.
ENDINGS AND BEGINNINGS.

istory is a great perpetrator of anachronisms. She is

“débordante, frénétique,
Inconvenante; ici le nain, là le géant,
Tout à la fois.”

But

“Il faut bien tolérer quelques excès de verve


Chez un si grand poète.”[8]

All ages in one; all types tossed together pêle-mêle; repetitions,


contradictions, violent contrasts, inexplicable inconsistencies no
novelist would have dared to invent.
Even in our little group among the Sabine hills, how many races,
periods, types were thrown together! In Fabricius, not a lifeless
fossil, but a living survival of the grand old Rome of law and order
and self-sacrificing patriotism, the traces of which had made it
possible for the corrupt new Rome to linger on so long. In Damaris,
not the painted artificial Hellenism of her present surroundings, but
a genuine afterglow of the noble, simple beauty of early Greece,
beauty as natural and inevitable as the beauty of the lines and
curves of flowers and waves. In Miriam, the fervent, adoring,
exulting, thirsting love for the God of the fathers of the old Hebrew
Psalmists; the boundless, helpful pity for men of the old Hebrew
prophets. In Eleazar, the old exclusive, passionate patriotism of his
people, which in the isolation of exile had so long only seemed to
survive in that passion for possession which the old prophets had so
continually detected and so unsparingly denounced; and now that
this icy spell was broken, the old passion of patriotism had revived in
the passionate love of the family, always recognized by the Law and
the Prophets as the sacred core of national life, the sacred shrine of
what was most heart-stirring in the national Ritual. In the Greek
hermit of the cave, a survival of the early Greek Church of the
Roman catacombs; and also an outpost of the great army of monks
and solitaries, which was to conquer the wildernesses, material and
moral, of Western Christendom. In Marius, sunset melting into dawn
through his Ethne; his weariness of the faded classicism of an
imitative culture, and the unreality of subtle debates about a faith
which had no bearing on practice, vanishing in the freshness of her
new heavenly life; all that was true and beautiful in the fading old
world living anew for him in the morning dew of her new day.
Soon after the Vandals had sailed off for Africa, Fabricius and
Marius went again to Rome to look after the desolated palace on the
Aventine. The walls were still there, but little else.
The Vandals, said to be the greatest experts at plunder among the
barbarians, had done their work effectually. Traces of barbaric feasts
were strewn about the deserted rooms; fragments of familiar
household treasures, cherished from childhood, were scattered over
the broken mosaic pavements as mere refuse of useless and
abandoned plunder; the frescoed walls were stained and scarred. In
the gardens the thickets of roses were trampled and crushed, the
trellised vines torn down and broken. There was a sense of outrage
and desecration over all, which for the time made the dear familiar
things and places terrible and weird and ghastly. They had to say to
themselves again and again—“These trampled flowers, and prostrate
vines, and despoiled halls and chambers do not feel their dishonour.
And ere long for us also the vulgar associations scrawled over them
will be obliterated, and the earlier characters will reappear.”
And Marius said—
“Ethne would see through it all at once. Being a creature of the
light, naturally she always looks through to the light, and therefore
can always read all the palimpsests, and see through to all the
original sacred texts, in Attila, in old Eleazar, or in our Rome.”
Fabricius made some worldly lamentations over the destruction of
property for his children.
“I thought to have endowed thee and thy children richly,” he said,
“as becomes our ancient house. But between the Vandals and the
Huns, and our own tax-gatherers, the beggary of the citizens, and
the robberies of the slaves, there will, I fear, be little left for thee
and thine to inherit.”
“We inherit you,” Marius said; “thee and all thou art, our mother
and all she is. And what inheritance can be worth that to us? What
do rich men often leave to their heirs, but the inheritance not of
their gold but of their avarice, the inheritance of a paralyzed hand
unable to use or to give, but only to close on what it has; the curse
of an insatiable hunger for more; the spell of a heap of gold which
they have to toil to heap up higher, enchanted into beasts of burden
or mere blind earthworms?”
“And yet,” said Fabricius, “they say the earthworms help to build
and shape the world. But, however that may be, it is a good thing to
see the spell reversed, as in Eleazar the Jew, transformed back from
an earthworm into a man; the gold gone, the enchantment broken,
and the man himself again. God keep us from all such
enchantments.”
“It seems,” said Marius, “that in these days of sieges and sacks
there is a good chance of the spells being broken. Perhaps if days of
prosperity and peace ever come again, they may bring back baser
idols and more unconquerable spells.”
When they returned to the Sabine hills they found all in full
festival: the corridors of the villa festooned and garlanded with
flowers and fruits, the labourers on the estate and the children of
the mountain farm gathered for the joy of harvest; Eleazar, like one
of the patriarchs of his race, with the “heritage and gift” of Rachel
and her children clustered round him, Miriam with the last babe on
her knee, Damaris guiding the first baby-steps of little Paul, Rachel
in her stately Oriental beauty, Ethne fair and radiant as morning
serving every one.
While the children pelted or garlanded each other with the lavish
wealth of roses, and filled the place with the music of their laughter,
Fabricius drew near Eleazar, and the old men sat down together.
“The world is sad enough,” Fabricius said, “for thy people and for
mine; but the children are glad!”
And a soft voice near murmured—
“Their angels always behold the face of God.”
“The God of our fathers gave us homes before He gave us a
Temple and a priesthood,” Eleazar said meditatively. “Perhaps He is
leading us back to these earliest temples, where the father is the
priest and the children are the singers.”
“I have just heard a story which reads like a parable,” Fabricius
replied. “The ancient treasures of your Jerusalem and of our Rome
have fallen alike into the hands of the Vandals; but their fate has
been quite opposite. Yours have been borne safely to another shore;
but ours lie lost for ever in the depths of the sea.”
Ethne was standing near, and she knelt down and laid her gentle
touch on the hand of Fabricius.
“Father,” she said, “shall anything really good perish and be lost
for ever in the depths of any sea? Does not your old Rome live on in
her great laws, and in our own Leo? Are not all the real treasures
carried on and translated into their true use and meaning in the
Kingdom of our Christ?”
And Damaris, with little Paul in her arms, added—
“Surely all the true treasures of all the temples shall be saved, to
be understood and used better by the babes who shall succeed us
here; and,” she concluded in a lower voice, “to be carried safely
across the sea to the other shore, whither we are going, to the land
of the living, to the City which hath the foundations.”
The families of the Anician villa and the freehold farm on the
mountains, the ancient inheritance of its possessors, dating back
with a pedigree beyond the beginnings of Rome, were much linked
together.
Through Miriam and Eleazar, Rachel and her children, the first
Testament of God came to Ethne and her children, as a great
national literature and history. Abraham in his tents with his flocks
and herds; David, shepherd, hero, and king; Job, the great chieftain,
who saw the dark side of the world and ventured to bewail it to God,
and was not rejected by Him, but accepted and honoured; Moses,
loving his rebellious people more than himself, and leading them
through sea and desert; Daniel in the lions’ den; the Three Children
who chose the fire rather than falsehood, and walked through the
fire unharmed beside One like the Son of God;—all these were living
persons of a living story to Ethne’s children. Dear, moreover, to
Ethne with an intimate affection, besides these earthly friends, were
the heavenly friends of the toiling and the suffering—the angel who
came to the forsaken slave-woman, and called her by name, and led
her back to her dying child, that God might open her eyes to see the
“well,” and the child might live; the angel who came to the
despairing prophet, and brought him the little cake, when less
sympathetic mortals might have inflicted on him a sermon on
despondency. To her the voices of the old Hebrew prophets also,
with the magnificent daring of their denunciations of oppression and
wrong, came as fresh and inspiring as if she had heard them in the
palaces on the Palatine but yesterday, or anywhere in the streets of
Orleans and Troyes.
It was much thus to learn those unrivalled old human stories,
those unique old Divine messages, not packed up in a lesson-book,
nor crumbled down into texts, nor beaten thin into allegories, but
real and fresh as the stories of Patrick or of Leo,—whilst always
shining through and through with the Divine light, which those who
most frankly recognize the human medium feel most vividly.
Delightful also it was to her beyond words, to see the light of the
fulfilment of the New Testament of God, of the Christ, slowly
penetrating into the soul of Eleazar, as it had into the heart of Miriam
long before.
The New Testament, the Gospels, the Acts of the Apostles,
epistolary treatises, familiar letters, came to Ethne’s children from
the lips of Damaris in the language of Paul and John, in living speech
as familiar to Damaris as the words of Shakespeare and the great
Elizabethans to us.
“Thy Jerome’s Vulgate is as good and grand as our Claudian
aqueduct,” Ethne would say to Damaris; “but thy Greek is as the
Fons Ceruleus, the Aqua Claudia, the fountains bursting fresh from
the depths of these hills.”
It was the last lingering sound of living Greek (the first language
of the early Church) in the Western world. For centuries afterwards
the living waters flowed to Western Christendom through Jerome’s
aqueduct. The great Leo did not write or speak Greek.
Many a time also Ethne found the old Greek hermit in his cave,
near Monte Cassino, and laid her little Paul in his arms for his
blessing. Once she told him of her dream after the birth of the child
—of the church crowning the mountains in place of the temple of
the old gods; of the company of mountain-folk, instead of leading
the lambs garlanded for sacrifice, bringing their children for baptism;
of the white-robed band pouring forth thence hither and thither
throughout the mountains, throughout the world, like streams
making the land fair and green wherever their footsteps came, like
angels bringing to men the glad tidings of great joy. And the old man
as he embraced the child said—
“And may this thy babe, lady, be one of those thy white-robed
angels and messengers of peace.”
One bright Sunday it happened that, as long before Lucia had
discovered Ethne diving deep into the old Hebrew poem of Job,
Marius found her greatly absorbed in a fresh manuscript. She was in
ecstasies of delight.
“You never told me of this,” she said. “This is a book of the
Prophets of the New Testament of God. I shall never need to dream
any more, for here is a Divine dream, a Vision of God! The disciple
beloved of the Lord was in the Spirit on this His Lord’s Day; saw
Him; saw the riddle of this earth and its solution; saw heaven open
from within; saw also the earth as it is, and was no more satisfied
with it than the chieftain of old; saw how it is a battle-field to the
end. But he also saw what the old chieftain could not see—that the
victory is sure, has been won for ever, is being won day by day.
Through all the din and wailing and tumult he heard the Hallelujahs
of those in heaven who see the meaning and the end; felt the soft
flow of the living fountains through all the blood and fire and smoke.
On earth he saw the multitudes struggling, toiling, enslaved,
oppressed, hungering and thirsting, and sick as of old in Galilee. In
heaven he saw another great multitude innumerable, white-robed,
with palms in their hands, yet longing and interceding for those who
battle and suffer below. On earth, storm and battle to the end; but
heaven shining through the rifts in the clouds all through to the end.
And at last not only a ‘multitude,’ but the City, the City which hath
the foundations coming down out of heaven from God. Earth also
right at last!—not only the hunger and thirst, but the sins, the
wrongs, and the curse and death itself gone for ever; His servants
serving Him for ever, His name shining in their foreheads,—His
name, which that beloved disciple always tells us is love, the Lamb
slain for love, the King conquering through love. You see there is no
need to dream any more! All we could dream of, beautiful, and
good, and holy, is unveiled here, and infinitely more than we could
dream. The beloved disciple saw it—saw it for us all.”
Before long another little son was given to Marius and Ethne, and
she said—
“His name must be called John, after that beloved one who saw. I
need no dream for him. We have the Divine dream and its
interpretation, the riddle and the solution, the Book of the unveiling.
We will go into the thick of the battle, thou and I and our children.
We must not grudge them their share of the glorious wounds, or the
hard victories. We must go back to the poor, plundered, wrecked
city, to our Rome, for victory is sure if we endure to the end.”
At Whitsuntide the family returned to the plundered palace on the
Aventine. The pain at the despoiling of the palace was swallowed up
in the threefold joy that Whitsuntide brought. In Constantine’s
baptistery, by the Church of St. John Lateran, in the porphyry font
filled from the fountains on the Sabine hills, Ethne’s second son was
baptized by the name of the beloved disciple, the great Apostle of
love, the Divine of the battles and the fountains.
And with this little John were received into the Church of Christ an
aged man and woman of the race of which He was born—Miriam
and Eleazar.
As in this great Whitsuntide baptism the large company of the
newly-baptized were gathered together in their white baptismal
robes, with the chrism on their foreheads, the voice of Leo rang
through the silence in the vast spaces of the great basilica, and
penetrated every heart, as he proclaimed—
“This day’s solemnity, beloved, is to be accounted among our
foremost festivals. For as to the Hebrew people of old, fifty days
after the immolation of the paschal lamb, the law was given from
Mount Sinai; so after the Passion of Christ, whereby the true Lamb
of God was slain, on the fiftieth day after His Resurrection, the Holy
Spirit descended on the Apostles, and on the people of the faithful,
so that the diligent Christian may recognize how the preparation
(initia) of the Old Testament ministered to the beginnings (principiis)
of the New, and the second was founded by the same Spirit who
instituted the first.”
As the great Bishop spake these words, Ethne’s heart turned
sympathetically to her Hebrew friends. And then came a bit
especially for her own Ireland.
“Oh, how swift,” Leo said, “is the speech of wisdom! And when
God is the Teacher, how quickly what is taught is learned! The Spirit
of Truth bloweth where He listeth. The peculiar (propriæ) voices of
every nation are made one common tongue in the mouth of the
Church. From this day the trumpet of evangelic preaching has
pealed forth. From this day showers of gifts and rivers of blessing
have watered every desert. The Spirit of God has been on the
waters, renewing the face of the earth; and on the departing
darkness flashes the new dawn, sparkling in the many colours of the
various tongues, indwelling in each heart as a fiery force to consume
sin, to create intelligent perception, to illumine every faculty. Let us
with one heart incite one another to the veneration of this Holy
Spirit, by Whom the whole Catholic Church is sanctified, by Whom
every soul is imbued with reason, Who is the Inspirer of faith, the
Teacher of science, the Fount of love, the Seal of chastity, the cause
of all virtue. From Him is the calling on the Father, from Him are the
tears of penitents, from Him the groans of suppliants; and ‘none can
call Jesus Lord except by Him.’ For the Spirit of Truth Himself makes
the house of His glory shine with the splendour of His own light, and
in His temple He will suffer nothing dark nor anything lukewarm.”
It was always Ethne’s delight to bring Eleazar and Miriam to
everything that linked the old with the new. She rejoiced therefore
when, at the Festival of the Seven Maccabæan martyrs, Leo did
honour to that noble mother of their race, the mother of the seven
Maccabæan martyr brothers.
“Blessed mother! blessed progeny!” he said. “The palms of these
seven martyrs are multiplied sevenfold—the first suffering without
the help of an example; the last tortured in all the tortures of the
others; whilst each conquers in all, all have won the sevenfold crown
of each.”
And then—“The battle indeed,” he said, “never ceases for the
Christian. Thou who dreamest that the days of persecution are past,
that for thee there is no combat with the enemy, search into the
recesses of thine own heart, and see if no tyrant seeks to rule in the
citadel there. Make thou no truce with avarice; despise thou the
increase of unjust gain; refuse thou any compact with pride; chase
away enervating luxury; repel thou injustice; contend with
falsehood. And when thou findest thy combats multiplied, do thou
also, a follower of these martyrs, seek with them a multiplied victory.
We die to sin when sins die in us; and men become dead to the
world, not by the perishing of the senses, but by the death of vices.
Let each of you be mindful that the Temple of God is founded in
Himself.”
Thus day by day and year by year Ethne and Marius, and all that
little company of the Aventine, sought to keep their post in the great
battle, contending in Rome against her tyrannies and miseries and
sins, and making the plundered palace rich and beautiful again by
gathering thither the orphans, the cripples, and the aged left
destitute and forsaken by the sack of the Vandals; whilst among the
Sabine hills they sought to bring freedom of soul to the slave, and
the light of Christ to the lingering paganism of the peasants.
And all the time they were upheld by the holy example, and
inspired by the trumpet-calls of Leo, rebuking the careless,
encouraging the desponding, reviving the faint, enkindling the
foremost to press on further.
Old Rome lived on, they felt, in Leo. His far-seeing eye reached
from end to end of Christendom. His strong hand held the dissolving
world and the distracted Church together.
His great life-battle was indeed drawing to a close. Underneath
the vague Pantheisms from the East, brought into the West, into
Rome and Spain, through Manicheans and Priscillians, he had
detected the corruption of moral life, the relaxing of all the ties of
duty and loyalty, and had fought against them to the death, not
indeed gently either in word or deed.
Through the subtle speculations of Greek thought he had felt the
entangling embrace of a parasite, eating out the life of Christianity,
and had kept and unfolded for the Church the great primitive faith in
the Divine and human Christ. Around him was a broken, bewildered
Christendom; on the shores of Africa, a Church with magnificent
traditions of martyrs and fathers, Perpetua, Felicitas, Cyprian,
Augustine, long torn to pieces by schisms, now lying helpless under
the tyranny of the Arian Vandals, ready to become the prey of the
Moslem invasion so soon to come and crush both Catholic and Arian
under one weight of death. In the East, heresies innumerable,
originating in the subtle thinkers of Alexandria and Antioch, fought
out by the fierce monks of the desert; Syria, Greece, Egypt,
Carthage biting and devouring one another until the common enemy
came and destroyed them all. Spain was in the hands of Arians; Gaul
torn between contending races and beliefs; Britain had relapsed into
heathenism. The one thing needful at the moment seemed to be
Unity, and for this unity Leo sacrificed, strove, and toiled. And his
own soul being a city at unity within itself, with primitive simplicity of
character, Roman strength of will, Christian singleness of heart, this
unity he succeeded in preserving through that distracted age. But
always with him unity was a means and not an end, the essential
condition of life, valued for the sake of the life it guarded; and
always he worked with the sense that he, a mortal man, was
working under an Immortal King for an immortal kingdom; always
with the sense that he, “the successor of Peter,” could do nothing
but by standing on the rock of Peter’s confession, always translating
the old Roman order and law, the old simple apostolic confession of
Christ, into the languages of the new world.
So the great Bishop battled on, until at last, six years after he had
saved the city for the second time by his mediation with the Vandals,
the faithful voice was silenced on earth for ever.
It was in the corridor of the villa on the Sabine hills that Marius
brought home the news of the death of Leo. He had just gained one
more victory for the faith, over the subtle heresies of the East. “The
glory of the day is everywhere arisen,” he wrote, “the Divine
Mystery, the Incarnation, is restored to the age. It is the world’s
second Festival since the Advent of the Lord.”
The battle for him was over. The great commander could say at
last his “Nunc Dimittis,” “Let me depart in peace, for mine eyes have
seen Thy salvation.”
And he had been “liberated in peace.”
“No more shall we hear his clear strong words of hope and love,”
Marius said. “No more in any new peril that may come on her will
Rome have Leo to save her by throwing himself into the chasm.”
A hush of awe and tender gratitude fell on them all. Fabricius said

“The last of the great Romans has departed.”
And Damaris—
“The latest of the great saints has entered into life.”
As always, death completed life. And they first saw the noble life
in its true meanings and proportions in the silent sculpture of death.
They felt he was indeed Leo the Great; and only at the altar, as
Monica had said to Augustine, could be his highest commemoration:
“With the angels and archangels and all the company of heaven”
rendering thanks for all he had done, and been, and become.
When they returned to the Aventine from the solemn obsequies of
the Shepherd and Father of Rome, Marius said to Ethne—
“Thou hast never been perplexed by anything that seemed
doubtful in the great Bishop’s life; not about his contest with Hilary
of Arles, nor even about his forbidding the ordination of slaves.”
“Why should I?” she said; “Leo never claimed to be anything in
himself. Has he not taught us all to say day by day in our prayers,
that ‘we can do nothing good without God’? Has he not taught us
never to be satisfied with ourselves, but always to pray on and on
continually for ‘the increase of faith and hope and charity’? Has he
not taught us that the ‘world is ordered by the governance,’ not of
emperors or generals, or the greatest in the world, or the holiest in
the Church, but ‘by God’? Has he not taught us that the destiny and
mission of the Catholic Church, from the lowest to the highest, is not
to rule, but to ‘serve Him in all godly quietness’?”
“Many think he is building up a new tyranny,” Marius said, “in the
kingdom of God.”
And Ethne replied, with her far-away look as of second sight—
“As far as what Leo builds is only Rome, will it not perish like the
other Rome? As far as it is chiefly Peter’s, did not the blessed Peter
himself sink beneath the waves, only to be saved by the
outstretched hand of Peter’s Lord? But as far as it is Christ’s kingdom
and Peter’s rock, which is Christ, it cannot fail to stand. We make
aqueducts; God only opens the fountains. We build our little houses
of clay, which if the life dies out of them become prisons or tombs;
the living God creates living worlds. We make empires; God gives us
a little child, His Eternal Son, the manger and the cross. Did not Leo
tell us that ‘Peter is saying still every day throughout the Catholic
Church, “Thou art the Christ, the Son of the living God”’? And is not
our Leo also saying that for ever now, here below, and above?”
“To thee and such as thee indeed he is!” Marius said.
“And you know we have always our twin fountains,” she added,
“our Aqua Claudia and our Fons Ceruleus, ‘the Testaments of God.’
We have our one Book, our two literatures, never dead, always
spoken to us by the living voice; ‘breathed into us,’ as Leo told us,
‘by the living Spirit.’”
And so the days and years passed on. And the children grew into
youth, and the aged passed into the new youth above.
The first to pass away from them was Fabricius. The dishonour
and humiliation of Rome had lowered the already ebbing tide of life.
His gaze had always been one of wistful yearning towards the past;
but towards the close he learned to see that the past lives on in the
heavenly future.
After his death the palace on the Aventine became simply a group
of homes for the suffering and the destitute. And so by a natural
Divine classification, not of like with like, but with unlike, Damaris
gathered around her all kinds of suffering and need, the various
needs supplying and helping each other: the aged watching the
tottering steps of the young; the little ones gladdening the sick and
aged; each learning to feel that they had some gift to spare as well
as some need to be supplied. And thus with Damaris old age was
not a fading, but a ripening into the fuller life. One day she said to
Ethne, when some fresh sign of weakness had grieved the
daughter’s heart, as with a foresight of the close—
“Thou who lovest to dwell among thy fountains surely wilt not
grudge me to the land of the fountains of living waters! For what are
thy fountains after all, thy ‘fountain of heavenly blue’ and thy Aqua
Claudia, but aqueducts, though indeed aqueducts chiselled by Divine
hands? Whence do they come, the ever-flowing, exhaustless springs
of thy hills?”
And Ethne said, with the far-off look in her eyes—
“Truly the clouds, mother, are ever feeding the springs, and the
clouds drink of the seas; the smallest spring which is perennial must
indeed have its source in the infinite and the eternal.”
Damaris took her hands and laid them on her own heart.
“Higher than our highest hills,” she said, “we must go for our
fountains.”
“But,” said Ethne, “does not the Christ, did not our Leo, speak of a
well of living water springing up within us, here and now?”
“Surely He does,” Damaris replied. “And if He leads me by His
fountains above, I shall know that He, the Source of all the
fountains, is with thee here. I am leaving thee in no parched desert
land. How else could there be ‘no hunger nor thirst’ for me, there?”
“But the City of God,” Ethne resumed, with tearful pleading, “is
building also on earth; thou wilt not leave us too soon for the one
above? Hast thou not said that our Rome is a city not only of the
fountains, but of the steps? Stay with us! stay with us yet a little
while, and help our feebler feet to climb.”
And Damaris did stay yet a little while. But at last the last step for
her was reached, the step over the invisible threshold—and she
entered into light; but she did not leave them in darkness, for as she
entered, the light shone through on them.
“Death,” she had been wont to say, “does not close the door of
the unseen for us. Death is always keeping it open, both for those
he takes and for those he leaves behind.” And when she died they
found it true.
As the years went on, glad tidings came from Ireland of more
ground conquered, more souls won for Christ.
A beautiful story came of another captive and slave, the maiden
Brigit, set free to liberate the hearts of thousands; and from Brigit’s
large Irish heart came another hymn, to take its place on Ethne’s
heart with Patrick’s breastplate—

“I would a lake of hydromel for the King of kings;


I would that all the people of heaven should drink of it for ever;
I would the viands of faith and piety, and also instruments of
penitence in my house;
I would great cups of charity to distribute;
I would cellars full of graces for my companions;
I would that joy should be given at the banquet;
I would that Jesus—Jesus Himself—should reign over it;
I would that the three Maries of illustrious memory,
And that all the spirits should be gathered from all parts;
I would be the steward of the Lord,
And at the cost of a thousand sufferings receive His blessing;
I would a lake of hydromel for the King of kings.”

“The fountain indeed rises and rises in thy Ireland,” Marius would
say; “it is becoming a lake, a sea, the source of how many fountains
who can say?”
And Ethne—“How can we ever foresee where the new fountains
will spring up?”
“No more,” he replied, “than I could foresee thee.”
They did not indeed live to see how high the fountains would rise,
or how far they would flow. They did not live to hear the great
proclamation of freedom go forth from the lips of the great Leo’s
successor, the great Gregory, at the manumission of his own slaves,
basing the freedom of all men on the creation of man in the image
of God, and the Incarnation of the Son in the form of man. They did
not indeed live to see the living waters from the two fountains flow
forth throughout Western Christendom till they met in our English
land, from the great missions of the Benedictines and of the monks
of Iona; the era of the great monks and abbots succeeding the era
of the great bishops. But they saw their Paul enter the white-robed
company of their young kinsman Benedict on Monte Cassino; and
they gave their John to join the first-born of Baithene in the great
Irish monastery, which nurtured and sent forth Columba. And day by
day they and their children pressed onward, in the city, in the
solitude, in the home, armed with the breastplate of Patrick’s hymn

“Christ before us,


Christ behind us;
Christ around us,
Christ within us,”

and strong in the strength of Leo’s faith. “Although He has


committed His sheep to the care of many shepherds, Christ Himself
has never left the guardianship of His beloved flock.”
For
“God fulfils Himself in many ways.”
“IPSE TAMEN DILECTI GREGIS CUSTODIAM NON RELIQUIT.”
THE END.
FOOTNOTES
[1] Bagaudæ, the name given to the peasants who revolted
against Roman oppression in Gaul, said to be a Celtic word
meaning crowd or mob.
[2] Vide St. Leo, Epistola 4, ad Episcopos per Campaniam
Tusciam, &c., Acta Sanctorum, S. Leonis, Opera 1, p. 611.
[3] S. Leo, Sermon XXIII. These quotations are taken from
sermons of S. Leo on the Nativity and the Epiphany, in the Acta
Sanctorum.
[4] Epistles of S. Leo. The Tome, 28, Epistle to Flavian, Bishop
of Constantinople.
[5] The Tome, 28, Epistle.
[6] St. Benedict was of the Anician house, and the first habit of
the Benedictines was of white, or undyed, wool.
[7] St. Columba.
[8] Victor Hugo on Creation and Providence, Encore Dieu, L’art
d’être grandpère.

Richard Clay & Sons, Limited, London & Bungay.


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!

ebookfinal.com

You might also like