Guide to Java: A Concise Introduction to Programming (2nd Edition) James T. Streib download
Guide to Java: A Concise Introduction to Programming (2nd Edition) James T. Streib download
https://ebookmeta.com/product/guide-to-java-a-concise-
introduction-to-programming-2nd-edition-james-t-streib/
https://ebookmeta.com/product/concise-guide-to-databases-a-
practical-introduction-konstantinos-domdouzis/
https://ebookmeta.com/product/a-concise-introduction-to-robot-
programming-with-ros2-1st-edition-francisco-martin-rico/
https://ebookmeta.com/product/introduction-to-programming-with-
java-a-problem-solving-approach-3rd-edition-john-dean/
https://ebookmeta.com/product/the-eagle-has-eyes-the-fbi-
surveillance-of-cesar-estrada-chavez-of-the-united-farm-workers-
union-of-america-1965-1975-1st-edition-jose-angel-gutierrez/
War in the Mountains: Peasant Society and
Counterinsurgency in Algeria, 1918-1958 1st Edition
Neil Macmaster
https://ebookmeta.com/product/war-in-the-mountains-peasant-
society-and-counterinsurgency-in-algeria-1918-1958-1st-edition-
neil-macmaster/
https://ebookmeta.com/product/stunt-doubled-roommates-3-1st-
edition-stephanie-brother/
https://ebookmeta.com/product/software-telemetry-1st-edition-
jamie-riedesel/
https://ebookmeta.com/product/fakemas-a-holiday-instalove-
romance-briar-vale-1st-edition-gia-bailey/
https://ebookmeta.com/product/handbook-factory-planning-and-
design-1st-edition-hans-peter-wiendahl/
Wavelet Analysis: Basic Concepts and Applications 1st
Edition Sabrine Arfaoui
https://ebookmeta.com/product/wavelet-analysis-basic-concepts-
and-applications-1st-edition-sabrine-arfaoui/
Undergraduate Topics in Computer Science
Guide to Java
A Concise Introduction
to Programming
Second Edition
Undergraduate Topics in Computer Science
Series Editor
Ian Mackie, University of Sussex, Brighton, UK
Advisory Editors
Samson Abramsky , Department of Computer Science, University of Oxford,
Oxford, UK
Chris Hankin , Department of Computing, Imperial College London, London, UK
Mike Hinchey , Lero – The Irish Software Research Centre, University of
Limerick, Limerick, Ireland
Dexter C. Kozen, Department of Computer Science, Cornell University, Ithaca,
NY, USA
Andrew Pitts , Department of Computer Science and Technology, University of
Cambridge, Cambridge, UK
Hanne Riis Nielson , Department of Applied Mathematics and Computer Science,
Technical University of Denmark, Kongens Lyngby, Denmark
Steven S. Skiena, Department of Computer Science, Stony Brook University, Stony
Brook, NY, USA
Iain Stewart , Department of Computer Science, Durham University, Durham,
UK
Joseph Migga Kizza, College of Engineering and Computer Science,
The University of Tennessee-Chattanooga, Chattanooga, TN, USA
‘Undergraduate Topics in Computer Science’ (UTiCS) delivers high-quality
instructional content for undergraduates studying in all areas of computing and
information science. From core foundational and theoretical material to final-year
topics and applications, UTiCS books take a fresh, concise, and modern approach
and are ideal for self-study or for a one- or two-semester course. The texts are all
authored by established experts in their fields, reviewed by an international advisory
board, and contain numerous examples and problems, many of which include fully
worked solutions.
The UTiCS concept relies on high-quality, concise books in softback format, and
generally a maximum of 275–300 pages. For undergraduate textbooks that are
likely to be longer, more expository, Springer continues to offer the highly regarded
Texts in Computer Science series, to which we refer potential authors.
James T. Streib Takako Soma
•
Guide to Java
A Concise Introduction to Programming
Second Edition
123
James T. Streib Takako Soma
Program in Computer Science Program in Computer Science
Illinois College Illinois College
Jacksonville, IL, USA Jacksonville, IL, USA
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
Purpose
The purpose of this text is to help the reader learn very quickly how to program using the
Java programming language. This is accomplished by concentrating on the fundamentals,
providing plenty of illustrations and examples, and using visual contour diagrams to
illustrate the object-oriented semantics of the language.
Need
This text attempts to fill the gap between the above two types of books. First, it provides
plenty of examples and concentrates primarily on the fundamentals of the Java
programming language so that the reader can stay focused on the key concepts. Second, by
concentrating on the fundamentals, it allows the text to be more concise and yet still
accessible to readers who have no prior programming experience. The result is that the
reader can learn the Java programming language very quickly and also have a good
foundation to learn more complex topics later.
v
vi Preface
The second edition retains all the features of the first edition. In addition to fixing any
known errors, any areas that could be clarified have been reworded. Features new to the
second edition, include the following:
Typically, there are three ways objects can be introduced to the beginning programmer:
Objects first.
Objects last.
Objects interleaved.
This text takes the latter approach where objects are discussed in Chapters 2, 5, and 9.
However, recognizing that some readers and instructors might want to use one of the first
two approaches, this text can be read using alternative orders. For example, should an
viii Preface
objects first approach want to be taken, after reading Chapter 1, Chapters 2 and 5 can be
read next, followed by Chapters 3 and 4. Should an object later approach want to be used,
Chapters 3 and 4 can be read prior to Chapters 2 and 5.
To help facilitate these alternative approaches, starting with Chapter 3, the Complete
Program sections at the end of each chapter have examples with and without using objects.
Note that Chapter 9 requires an understanding of arrays, which is covered in Chapter 7,
and it can be read after completing that chapter.
Scope
As mentioned previously, this text concentrates on the fundamentals of the Java
programming language such as input/output, object-oriented programming, arithmetic and
logic instructions, control structures, strings, arrays including elementary sorting and
searching, recursion, files, bit-wise logic, and parallel processing programming. As a result,
it might not cover all the details that are found in some other texts, and if necessary, these
topics can be supplemented by the instructor or reader, or covered in a subsequent text
and/or second semester course.
Audience
This text is intended primarily for readers who have not had any previous programming
experience; however, this does not preclude its use by others who have programmed
previously. It can serve as a text in an introductory programming course, as an introduction
to a second language in a practicum course, as a supplement in a course on the concepts of
programming languages, or as a self-study guide in either academe or industry. Although
no prior programming is assumed, it is recommended that readers have the equivalent of
an introduction to functions course that includes trigonometry which will help with
problem solving and understanding the examples presented in the text.
Acknowledgments
In addition to the reviewers of the first edition, the authors would like to thank Mark E.
Bollman of Albion College and James W. Chaffee of the University of Iowa for their
continued work on this edition. Also, the authors would like to acknowledge the students
of Illinois College who have read and used various sections of the first edition in the
classroom. On a personal note, James Streib would like to thank his wife Kimberly A.
Streib and son Daniel M. Streib. Takako Soma would like to thank her family and friends,
near and far.
Note that Java is a registered trademark of Oracle and/or its affiliates and that Windows
is a registered trademark of Microsoft Corporation in the United States and/or other
countries.
Feedback
The possibility of errors exist in any text, therefore any corrections, comments, or
suggestions are welcome and can be sent to the authors via the e-mail addresses below. In
addition to copies of the complete programs presented in the text, any significant
corrections can be found at the website below.
Preface ix
Website: http://www.jtstreib.com/GuideJavaProgramming.html
xi
xii Contents
1.8.5 Summing 41
1.8.6 Arithmetic Functions 42
1.9 Comments 43
1.10 Complete Program: Implementing a Simple Program 44
1.11 Summary 46
1.12 Exercises (Items Marked with an * Have Solutions in Appendix E) 47
2 Objects: An Introduction 51
2.1 Introduction 51
2.2 Classes and Objects 51
2.3 Public and Private Data Members 52
2.4 Value-Returning Methods 52
2.5 void Methods and Parameters 53
2.6 Creating Objects and Invoking Methods 54
2.7 Contour Diagrams 56
2.8 Constructors 62
2.9 Multiple Objects and Classes 66
2.10 Unified Modeling Language (UML) Class Diagrams 73
2.11 Complete Program: Implementing a Simple Class and
Client Program 75
2.12 Summary 77
2.13 Exercises (Items Marked with an * Have Solutions in
Appendix E) 78
3 Selection Structures 83
3.1 Introduction 83
3.2 If-Then Structure 83
3.3 If-Then-Else Structure 88
3.4 Nested If Structures 91
3.4.1 If-Then-Else-If Structure 91
3.4.2 If-Then-If Structure 94
3.4.3 Dangling Else Problem 96
3.5 Logical Operators 99
3.6 Case Structure 105
3.7 Complete Programs: Implementing Selection Structures 111
3.7.1 Simple Program 111
3.7.2 Program with Objects 114
3.8 Summary 116
3.9 Exercises (Items Marked with an * Have Solutions in Appendix E) 116
6 Strings 203
6.1 Introduction 203
6.2 String Class 203
6.3 String Concatenation 204
6.4 Methods in String Class 206
6.4.1 The length Method 206
6.4.2 The indexOf Method 206
6.4.3 The substring Method 207
6.4.4 Comparison of Two String Objects 209
6.4.5 The equalsIgnoreCase Method 211
6.4.6 The charAt Method 212
6.5 The toString Method 213
6.6 Complete Program: Implementing String Objects 215
6.7 Summary 219
6.8 Exercises (Items Marked with an * Have Solutions in Appendix E) 219
7 Arrays 223
7.1 Introduction 223
7.2 Array Declaration 223
xiv Contents
8 Recursion 265
8.1 Introduction 265
8.2 The Power Function 265
8.3 Stack Frames 274
8.4 Fibonacci Numbers 277
8.5 Complete Program: Implementing Recursion 289
8.6 Summary 291
8.7 Exercises (Items Marked with an * Have Solutions in Appendix E) 291
as they stand cannot claim to have happened. And yet the Little Flowers, in
their bluntness and simplicity, have all the charm of an unreflective and
uncritical belief in the beauty of the new teaching. They give a true picture
of humble life in mediæval Italy and show us the early Franciscans in the
light in which they saw themselves. The book was widely read, and the first
part, which dealt with St Francis among his followers, was amplified by
accounts of the mad and saintly freaks of Fra Ginepro, and of the
steadfastness with which Fra Egidio kept to his resolve of living by the
labour of his hands. The influence of the Poverello of Assisi was, in fact,
felt by the highest and the lowest alike. While current fables made popular
heroes of him and his followers, Giotto at Assisi represented the decisive
incidents of his life in a series of paintings, which have been likened to an
epic, and Dante devoted an entire canto of the Paradiso to his praise. In the
Paradiso the praise of St Francis is sung by St Thomas Aquinas, the
greatest of the followers of St Dominic, while the praise of St Dominic is
sung by St Bonaventura, the most influential of Franciscans, a proof of the
bond which united the two orders in Dante’s mind. The jealousy which
afterwards estranged them was never as pronounced in Italy as north of the
Alps. In many churches the figures of St Francis and St Dominic still stand
side by side. And Andrea della Robbia, in a most charming relief in the
Piazza Santa Maria Novella at Florence, gave expression to the affection of
the two orders by representing their founders embracing as they meet.
And how shall we picture him in the flesh, the man who was so close to
the best side of the religion and the morality of his age? In the year 1222 St
Francis, attracted by the thought of St Benedict, went to stay at the ancient
monastery at Subiaco, and here, in memory of his visit, his portrait was
painted on the wall of a chapel which was completed before 1228. On this
picture St Francis is represented without the stigmata and without a halo.
He wears the penitent’s rough garb with a cord round his waist, and he is
designated simply as Frater Franciscus. The Poverello is seen full face. His
figure is slim, his hair and beard are crisp and fair, his face is long and thin.
In spite of a certain awkwardness, due no doubt to the painter, he has an
appearance of refinement and delicacy well in keeping with the stock from
which he had sprung. His large eyes and parted lips suggest the enthusiast;
his thin neck and slender hands belong to a physique which might well
contract phthisis. There are other early pictures of St Francis. But the great
painters who set forth his life’s history do not appear to have been directly
influenced by them. Thode has shown how, in some parts of Italy, a bearded
type of the saint is traditional, in others a beardless type. Sometimes he was
painted dark, sometimes fair, sometimes comely in figure, sometimes
emaciated. Even Giotto, judging by the two series of pictures he painted,
the one at Assisi, the other in the church of Santa Croce in Florence, had
before him different ideal types of the saint.
Were it not for the ravages of time, the convent at La Verna would
possess one of the early cycles of pictures representing the story of St
Francis. A chapel was erected in 1264 on the spot where St Francis received
the most holy stigmata, and Taddeo Gaddi, the godson and pupil of Giotto,
was summoned to decorate it. No trace of the work remains. Taddeo’s stay
at La Verna was however productive of other results. A youth from the
neighbouring Pratovecchio, Jacopo Landini, was sent to work under him,
and he afterwards went to Florence and gained considerable renown as
Jacopo del Casentino. In later life he returned to his native district, where
some paintings of his are extant. Vasari includes an account of him in his
Lives of the Painters, and he tells us that it was due to Jacopo that the
painters of Florence first combined together in a guild (compania e
fraternita) in 1350.
As it stands at present the retreat of La Verna is distinguished chiefly by
the large number of its altar-pieces in glazed terra cotta by the della
Robbias. Except in the museum at Florence there are nowhere so many fine
examples of their work to be found together. They are gifts for the most part
from distinguished Florentine families. They include a large altar-piece, on
which the Virgin is seen handing her girdle to St Thomas; a Transfiguration,
on a large scale, with the figures of the twelve Apostles standing below in
beautiful grouping and the most varied expression. There is a Nativity with
the figures of St Francis and St Anthony of Padua behind the Virgin and St
Joseph, and an Annunciation; both of these are of exquisite grace. All these
altar-pieces and other single figures, such as St Francis, are in the usual
style of blue and white. I find them variously attributed to Luca and to
Andrea della Robbia. In the gallery on the way to the chapel there is a large
Pietà in polychrome. The most beautiful, however, of all is a large altar-
piece of the Crucifixion, the sole decoration of the Chapel of the Stigmata.
Slowly we ascended the steep path which led up to the convent. We
passed under an archway and found ourselves before the entrance to the
main church. The site of La Verna was granted to St Francis by Count
Orlando of Chiusi in the year 1213; it was the only gift of a site ever
accepted by the saint, who held himself betrothed to poverty. Probably a
small church was erected under his direction; but when the fame spread of
his having here received the impress of the stigmata, a special interest
attached to the site. Pope Alexander IV. took the “Mons Alvernus” under his
protection; in 1260 a church was consecrated in the presence of
Bonaventura and six bishops; and a few years later the Chapel of the
Stigmata was built through the munificence of Count Simone of Battifolle.
The chief church is now a large one; it was begun in 1348, but it was not
completed till some time in the fifteenth century, when the whole settlement
of La Verna, the “Seraphicus Mons,” as it was called, had passed under the
protectorate of the Signory of Florence.
The churches at La Verna form part of a vast mass of buildings. We were
told that the convent affords accommodation for five hundred friars. As we
were about to enter the main church we met some of them walking in a
procession, two and two. They had been celebrating service in church, and
now they walked down the gallery to conclude it in the chapel, chanting as
they went along. We afterwards met them again coming out. There were
forty of them, vigorous men for the most part, wearing the rough brown
frock and cord, with sandals on their bare feet. It was difficult to tell at a
glance from what class they were drawn; certainly not from the higher and
more refined. They greatly differed as to age, and the older men had the
better appearance. On the whole they were not dignified in bearing, and in
person did not look as clean as they might have done.
We spent a long time in church, looking at the altar-piece and reading
what the guide-book to the Casentino of Beni had to say of La Verna. This
is the only guide-book to the district as far as I know. It was our constant
companion, but we found that it required close and repeated reading, for it
is a queer jumble of all kinds of information. We then wandered along the
gallery which bridges the abyss between the settlement and the isolated bit
of rock on which stands the Chapel of the Stigmata. With its dark panelling
and its one large altar-piece this chapel is a true place of rest. Its large della
Robbia represents the Crucifixion, with the figures of the Virgin, St John
the Baptist, St Jerome and St Francis standing and kneeling below. This
association of saints of later date with the characters of Scripture comes at
first as a shock to the historical mind; to the Middle Ages it appeared
natural. St Anthony of Padua, in a vision, saw the child Christ sitting on his
prayer-book. St Bernard, in a vision, saw the Virgin standing before him.
When these scenes came to be represented in art they assumed the form of
real incidents. And by a further development, St Francis and other holy men
and women of the Middle Ages were pictured in contemplation of the
Nativity, the Crucifixion and other decisive moments in Biblical history as
though they had been present at them in the flesh.
There were other sights to be seen at La Verna: the rocky chasm where
St Francis hurled aside the devil, and the Luoghi Santi, a number of grottoes
and rock-hewn chambers where the saint once lived. Visitors from all parts
of the world come to La Verna, and on Sundays they say there are crowds of
country people all eager for the sights. For myself, I was content with what
I had seen and glad to rest in the convent, where an old friar gave us wine
and water to drink. He chatted about the convent and about himself. How
long had he stayed there—forty years? Yes, quite that. Fifty? Quite likely, it
came to much the same thing. I had recently been reading the Life of St
Francis by Sabatier, a charming writer, who makes the joyful side of the
saint’s nature very real. The old friar remembered his stay at La Verna, but
he would not say much about him.
Then we sat outside under the huge beeches, as yet bare of foliage,
listening to the birds, which seemed as numerous and as tuneful as they
were seven hundred years ago. With the sun shining brilliantly we started
homewards to Bibbiena. The ascent of the Penna, and a walk over to Chiusi,
which lay below in a streak of blue mist, are expeditions I should wish to
make if I ever again visit the district.
IV
“Qui è Romualdo
Qui son’ li frati miei che dentro il chiostro
Fermar li piedi e tennero il cuor saldo.”
(Par. 22, 49 ff.)
CAMALDOLI (CASENTINO)
usually two storeys high. And both are covered with red rough-tiled roofs
that lie flat and broad over the entire dwelling and project on all sides into
wide eaves.
We passed through Camprena, a posto which also had its peculiarity. The
houses neither fronted the street nor stood at right angles to it, a want of
arrangement not accounted for by any apparent irregularity of the ground.
Such an Italian village has none of the neat clustering of its English or
German namesake. There is no village church standing aloof to watch over
the entrance and exit from life of suffering humanity; no village green with
ancient oak suggesting a living protection to rights and liberties; no well-
appointed inn betokening the love of an evening’s good cheer. The houses
have come together anyhow, and few are the attempts made to brighten a
portico or a window with a row of flower-pots. Sometimes the house itself
is washed over with pink or yellow, but there is never a scrap of flower-
garden to add a bright spot of colour to its surroundings.
Further along the road lay Soci, a place which went through stormy
experiences in the early Middle Ages. Remains of its own castle walls and
remains of the castles of Gressa and Marciano, which frown from heights
above and beyond it, recall the times when might made havoc with right. At
one time the Prince Bishop of Arezzo owned the place and made it over to
the monks of Camaldoli. But, apparently on account of its insecurity, they
parted with it to one of the Counts Guidi in exchange for rights of
ownership at Bagno on the further side of the Apennines. However, the
Guidi did not long remain in possession of the castle; they lost it to their
enemies, the Tarlati of Pietramala.
Soci is now a growing centre of industry, and boasts of several factories.
The high chimney of one of these figures is the attractive feature on the
local picture post card. The thought often arises in these days at what a
terrible cost to itself mankind is securing greater cheapness in goods—
raising the standard of comfort, as economists put it; the thought was
brought home in this outlying district. For the men and women we met in
other parts of the district were robust in health and decently, if poorly, clad;
the children were chubby, well-fed and full of buoyancy. But in places like
Soci a blight seemed to have fallen on mankind. Men and women, girls and
boys, all had the same look of mixed listlessness and craving, and the
children were pale and neglected. No doubt here, as elsewhere, the people
who flocked to the factories were impatient of the restraints and the penury
of home; they escaped from the toil of home, but they did so at the cost of
the home’s regularity of habit. Stranded in a strange place, bound by no
responsibilities but those they chose to recognise, these men and women
soon fell into irregular ways and formed illicit connections, with a
consequent loss of physique to themselves and a deterioration of the race in
a couple of generations.
Beyond Soci the mountains began to draw closer together. The road
followed the river Archiano, which flowed in a narrower bed and assumed
the character of a torrent. Only the land that was near the river was brought
under cultivation. The slopes above were covered with a thin scrub of
stunted oaks bearing only the sere foliage of last year’s growth. These
mountains were chiefly of a brown mud-rock that had crumbled away along
the water-courses, or else, undermined by them, had fallen in masses of soft
earth, forming the gentler slopes. Side-valleys opened and closed as we
passed onwards. The characteristics of the plain were disappearing more
and more. We were entering the region of the Apennines.
At one point of the road we were doubtful if we should leave the valley,
and seeing a man under a hay-stack munching bread and cheese we
consulted him. But his look was interested, and he was so positive that the
diverging path not being ours, we should never reach Camaldoli unless we
consented to his guidance, that we became equally positive the map should
be our only guide. We cut short further parleying by saying that we could
but return if we missed the way altogether. Of this there was no chance. A
short distance further and we sighted Serravalle, towering high on a steep
eminence that fronted all quarters. On one side it commanded the bend in
the road that led onwards across the Apennines into Romagna; on the other
it stood well above a dip in the hills, and overlooked the side-valley down
which the Fosso of Camaldoli flowed to join the Archiano. The mountain
streams throughout the Casentino are spoken of as fossi, though not
generally so designated on the map—a peculiar use of the word which
suggests affinity to the northern fos rather than to the Latin fossa. In sight of
Serravalle we sat for a while and feasted on our usual lunch of bread, eggs
and wine. After that we followed the stream for a time, and then, parting
company with it, we began the ascent up the steep winding slope.
On a clear day such as this, the steeper the ascent the more striking the
observation how the nearer mountains sink into insignificance before the
higher ranges that rise on the skyline beyond. Under the dome of blue, with
its few sailing clouds, the air was of absolute transparency, and every detail
of the level we had left, every detail of the level to which we were attaining,
stood out in shining clearness. Each special portion of the world above,
below, around had its distinguishing feature, from the flock of sheep
grazing by the stream below to the man carrying stakes up the opposite
slope, and to the dark birds hanging over Serravalle. But the observing
faculty soon wearied with watching for new impressions. With the brighter
sunshine, the keener air and the more fragrant vegetation of the height, a
dreamy consciousness took possession of the mind—a consciousness of
being nearer heaven—heaven, a fictitious limitation of space indeed, but a
limitation the thought of which brought one’s own concerns into an
amended relation to those of the world generally. After all, it is by drawing
imaginary circles that the mind attains to a conception of relative size. The
greater the height, the wider the outlook; the stronger the consciousness of
the world we possess not, the clearer the conception of that part of the
world which we have made our own.
Higher up patches of snow lay here and there on the shady side of the
path. The shrubs and plants became stunted and nipped, with the exception
of the flowering giant spurge that stood up from the stony ground vigorous
and brilliantly decorative. We passed a cluster of dwellings, built of rock
and founded on rock, grey and weather-worn, quite Alpine in character,
where the necessities of life are wrung from nature in a close hand-to-hand
fight. For a long time our path was rocky and uneven and lay between
thorny undergrowth. Then it led down at a gentle gradient and drew nearer
to the bed of the Fosso. Within a few minutes’ walk the character of the
surroundings entirely changed. From a stony wilderness we had passed into
an enchanted grove. The slopes lost their steepness, and the ground lost its
bareness. We walked under high chestnuts along a moss-grown path that
was soft to the tread, and then over a carpet of verdure bright with spring
flowers, which recalled the emerald meadow dotted with shining flowers
over which angels lead mortals to heaven in the painting of Fra Angelico. It
was late in the afternoon, and the slanting sun-rays made golden lights on
the trunks of the trees and set aglow the patches of primroses. The call of
the cuckoo sounded at intervals, and there was the distant warbling of many
woodland birds. One wished for the path to lengthen out indefinitely; all too
soon the massive settlement of Camaldoli, set against a forest of pines,
closed in the head of the valley.
There is a graceful legend concerning a monk (I forget his name) who
was one day tempted to stray from the path of life; he was sore perplexed in
his mind by the words of the Psalmist, “A thousand years in God’s sight are
but as yesterday.” How could time, that uniform flow “unaffected by the
speed or the motion of material things,” be robbed of the conception of its
length? How could time ever cease to exist to one who was endowed with
consciousness?
To the monk, as to many another, failing to see was failing to believe.
With a heavy heart he wandered forth into the convent garden carrying his
problem with him. Quod erat demonstrandum: would a greater intercede in
his behalf? Time slipped by unawares. It was late at night when he regained
the convent gate, but those who opened in answer to his call knew him not.
His talk, his appearance, his manner were strange to them, and yet there
was that in him which commanded attention—he was like as well as unlike.
They admitted him, and after a while the memory of an old, old story came
to one of the monks who listened to him—how long ago a member of the
fraternity had been troubled in his mind and had wandered forth and never
returned, but it had always been believed by some that he was still among
the living. After much seeking his name was found in an old convent
register. It was the name of the monk who had returned after a thousand
years. Then they saw him as one of themselves. The miracle was
accomplished. And the monk understood that eternities which are the
products of human conception hold good for man only. God’s eternities
may be different. It is said that a short time afterwards he passed away from
life in peace.
And would it be very different if that monk had been one of the
companions of St Romuald here at Camaldoli, nay not quite a thousand, just
nine hundred years ago? If he came back now would he know these
surroundings for those he had left? Would he feel it the same world as it
was then, ruled by the same ideas—that a simple life is conducive to
elevation of mind, and that the air of the heights and the pure water of
undefiled springs make the body strong to withstand evil? And would they
too know him as one of themselves, those venerable monks, bent with age
and dignified in bearing, who were approaching the monastery along the
upper road as we neared it along the lower? Their woollen robes of many
folds were white, such as Romuald in his dream beheld his companions
wearing, when, like Jacob, he saw a ladder set up on the earth and reaching
up to heaven, and his monks were the angels ascending and descending on
it. These men had drawn their hoods over their heads, and over them they
wore large, wide-brimmed Tuscan straw hats. They were neatly stockinged
and shoed, and most of them had flowing beards and a complexion that
reminded one of the delicate tints of crumpled rose-leaves. To us they were
figures of a distant past, and it was wonderful to think that if one of the old
monks of Romuald’s time were to come among them, the great difference in
them would be the first thing to strike him.
The monastic settlement of Camaldoli consisted of a monastery placed
near a famous spring, Fonte Buona, and of a hermitage, the Eremo, which
was situated further up among the mountains. One of the reasons of
Romuald’s success lay in his refounding hermit life on a new basis—it is
one mark of a genius to turn existing tendencies to new and profitable
account. In the monastery all were made welcome; to the hermitage those
were promoted whose temper proved their fitness for a solitary life. At the
present time only a small wing of the monastery was inhabited by the
monks, who rented it from the Government, the vast conglomerate of
buildings having been turned into a hotel. But the hermitage up among the
mountains was still entirely occupied by them. Up there lived those who
were able to endure the privations of hermit life; up there they remained till,
weakened by old age, they came down to the monastery to be tended in
sickness, and after death their mortal remains were carried back to the
Eremo to be buried in the ancient burial-ground.
The account of the life of St Romuald, which was written by St Peter
Damian, who belonged to the following generation, gives curious glimpses
of the attitude of men’s minds in a far-distant past. It is never easy to
transport one’s self to the moral and ethical standard of another age, for the
actions of the men who then stirred up the emotions and aroused
enthusiasm can be very differently interpreted; in one aspect they are
heroes, in another they are faddists. It is in this respect with Romuald as
with the holy man of another age, Diogenes the Cynic. Looked at from one
point of view, the courage with which Diogenes acted up to his convictions,
the cheerfulness with which he bore the hardships of slavery, and the
simplicity of life which he affected, bear the stamp of grandeur. Looked at
from another side, he is a man of oddities and eccentricities. Prompted in a
like direction, Romuald launched forth against misdeeds, discarded every
comfort, and commanded respect from the most powerful. But his
behaviour also appears absurd if we fix our minds on the way he courted
dirt, weakened himself by fasting, and wore himself out by imaginary
conflicts with the devil. And there are other points of similarity between the
cynic of classical antiquity and the saint of early Christianity. The cynic
called himself a citizen of the world, and the word cosmopolitan is held to
be his invention; while the saint exaggerated the power of his efforts so
vastly that “he looked forward to the time when the whole world would be
transformed into a hermitage, and the mass of the nations united in one
monastic order.” Both men were praised for their undisturbed serenity under
tribulation, and both in unabated vigour reached the extreme limits of old
age.
Let us look more closely into the account of Romuald’s life, an account
written by a great man and telling of a great man is surely worth analysis.
Romuald was a native of Ravenna, and was born early in the tenth century
of a noble family. As a youth he was witness to how his father killed a
relative; and he went to St Apollinare in Classe, to expiate the crime by
forty days’ penance. The church of St Apollinare is little changed from what
it was then, and visitors to Ravenna will recall with delight the simple
proportions of the roomy basilica, and its brilliant mosaics, with St
Apollinare preaching with his flock of sheep around him. A monk of the
church proposed that Romuald should join the fraternity, and the young
man agreed to do so, after spending a night in church, when St Apollinare
himself appeared as the monk had foretold—a proof, as Romuald declared
and as Peter Damian believed, that the saint really lay buried here. But
Romuald’s innate spirit of restlessness and want of consideration for the
shortcomings of others cut short his stay after three years’ noviciate. The
monks would lie in bed when it was time to be in church singing, and
Romuald, finding the church closed, sang in the dormitory. The monks
decided to rid themselves of the inconvenient enthusiast by throwing him
out of the window. Romuald, however, escaped to the woods, and there he
found a companion to his heart’s desire in the unlearned but ardent Marinus.
This holy hermit chanted through the entire psalter every day; he would
repeat twenty verses under one tree, twenty under the next, and so on till his
task was accomplished. Romuald joined him in his exercises, and mistakes
in his performance were punished by a blow on the ear from the hermit’s
staff. When his hearing became impaired in consequence, he turned his
other ear for castigation, and his stern master was touched. On three days of
the week the two hermits lived on a bit of bread and a handful of beans; on
the other four, crushed corn, pulmentum, constituted their food. Their
conduct was evidently considered unexceptionable, and in 978 when, in
consequence of an insurrection in Venice, Count Petro Orseolo, who had
headed it, was advised to seek refuge in a convent, Romuald and Marinus
were among those chosen to escort him to a monastery near Perpignan in
the south of France. There they resumed the old life, and were credited with
great holiness. Romuald’s fame increased owing to incidents such as this. A
lord of the neighbourhood, impeto barbarico, stole a cow from a peasant.
The peasant begged Romuald to ask for the cow, but the lord laughed his
request to scorn; the cow was roasted for the feast. However, the holy man’s
interference was not wasted. When the lord came to eat of the cow, a bit of
meat stuck in his throat and he died a wretched death. No wonder that the
people of the neighbourhood, when they heard that Romuald was about to
leave for Italy, as they could not retain him, decided to kill him so as at least
to secure his corpse. It was a time when relics, especially on the further side
of the Alps, commanded a high price in the market. Kings and emperors
gave gold and jewels in exchange for them, ecclesiastics of the higher
grades did not hesitate from stealing where they could not procure them
otherwise. And the relics did not lose by being transferred; on the contrary,
their wonder-working properties if anything increased. Romuald, however,
was apprised of the country folk’s intention, and knew how to meet it. He
rapidly shaved his head, and when they came, intending to kill him, they
found him eating immoderately. This was contrary to all accepted ideas of
saintliness; they thought he had gone mad and went away. The holy man
was left to depart in peace for Italy, where he found a new work awaiting
him. His father was about to leave the convent he had entered. This had to
be prevented. Romuald fastened his father’s feet in stocks, loaded him with
chains and whipped him till the old man’s senses returned. Romuald’s
career as a reformer now began, but, as his biographer says, “the zeal was
so great that glowed in this man’s breast that he was never satisfied with
what he had accomplished, and ever turned to new undertakings.”
Thus we find him at one time dwelling in a solitary cell in the marshes,
where, like St Guthlac in the fens of Lincolnshire, he was endlessly worried
through the lawless agency of bad spirits. After that, thanks to the
protection of Ugo, margrave of Tuscany, he collected about him a number
of monks at Bagno, in Romagna. But he so incensed them by sending
money to the relief of a distant monastery which had been consumed by fire
that he had to flee before their rage. Some years later, Romuald became for
a time abbot at St Apollinare in Classe, where he had stayed in his youth.
The Emperor Otto III., when he crossed the Alps in 996, heard that this
monastery was going to ruin, and he persuaded Romuald to reform the
monks. The influence which Romuald exerted on the melancholy young
emperor is full of interesting particulars. Otto went on a pilgrimage on foot
from Monte Gargano to Rome, and he spent some time with the hermit
Nilus, who was working for the reform of religious life in southern Italy
along lines similar to those Romuald was following in the north. Finally,
Otto spent forty days as a penitent in the convent at Ravenna, and was
almost persuaded by Romuald to become a monk. Romuald’s stay as abbot
at Classe was not, however, of long duration. He soon came and laid his
crozier at the emperor’s feet; an abbot’s life was not what he desired. His
zeal had taken another direction. He was fired by the thought of restoring
hermit life on the model of what had existed in Egypt, and he travelled
about from place to place collecting together wandering monks, the
gyrovagi, whom St Benedict had denounced as evil. He arranged that they
should dwell together, and join in the observance of certain rules.
This restoration of monastic life was part of a wider scheme. Reference
has been made to the growth of simony, both among laymen and
ecclesiastics. The evil had assumed such proportions towards the close of
the tenth century that the prestige of the Church was seriously jeopardised.
It was a critical epoch, and all depended on exposing the cause of the evil
and on stirring men’s consciences with regard to it. Romuald came forward
and openly declared that simony was the most damnable heresy, and that no
one who had entered the Church for money could hope for salvation unless
he gave up his benefice and became a layman. Peter Damian was of opinion
that, while no one acted directly in compliance with this request, the stir
which Romuald made was great. More than once he was in danger of his
life, and the experiences through which he went are full of interesting
particulars. At one time he lived for seven years as a hermit, and came back,
his body shrivelled, weather-stained and of the colour of a newt. But his
cutting himself off from the society of his fellows apparently led to many
conversions. At another time he was fired by the wish to take a part in
evangelising Hungary. Among the monks he had come across was a son of
the Prince of Hungary. But it was not to be. When Romuald and his
companions had gone some way on their journey, sickness overtook them,
and sickness returned to the party whenever it attempted to proceed. There
was nothing left to do but give up the undertaking and return to Italy.
Romuald’s fame was at its height when the Emperor Heinrich II. crossed
the Alps in 1022. So much was he moved by Romuald that he expressed the
wish that his soul were in the saint’s body. Romuald’s appearance at the
time was peculiar. Hoary, unkempt and unwashed, he came to court wearing
a dirty, shaggy skin. The Germans crowded round in the hope of snatching a
few hairs from it, which they wished to preserve as relics.
Romuald first came to Camaldoli about the year 1018. It has been
affirmed and denied that the site of the monastery was a gift to him from a
certain Count Maldolo, and that the name Camaldoli represents the words
Casa Malduli. The saint never stayed here long, and he died away from
here in his hermit’s cell at Val de Castro in 1027. But the routine of life at
Camaldoli was held to represent his aspirations, and Camaldoli gave its
name to all the monasteries which Romuald had founded. These were never
numerous. The order did not spread much beyond Italy and the south of
France. But within these limits it exerted considerable influence.
And thus attended by thoughts of the enthusiast who laid the foundations
of this vast establishment so many hundreds of years ago, we entered the
building by a long arched stone passage, which led up from the garden
without to the courtyard within. This courtyard is said to date from the tenth
century; I have rarely seen one more impressive through the stern simplicity
and perfect balance of its proportions. It is built throughout of the same
grey stone, and there is little attempt at ornamentation. Pillars with slightly
swelled shafts and simple capitals support round arches which extend round
the four sides of a paved court. In the centre of this court stands a fountain
with an unceasing flow of water. Passages, staircases and narrow corridors
lead off in different directions. Surely there could be nothing more suited to
the solitary side of one’s nature than to sit on one of the huge logs of wood
that lay on one side of the court, listening to the flow of the water and
watching the clouds that floated across the opening above. Now and again
there was the sound of voices and of footsteps coming and going in the far
distance. A man carried faggots across the court, a woman came to wash
lettuces at the fountain—living figures that moved in the round of duty and
seemed to emphasise the old-world solitude of the place. There is no greater
solitude than an open-air solitude from which the life of nature is excluded.
And within these walls there was no sign of animal or vegetable life—
nothing to remind one of the stirring of the sap or the beating of a pulse,
except that of which one was conscious of in one’s self.
That night we had the vast hotel of Camaldoli to ourselves. In the
springtime there are few visitors. We ate and slept in some rooms off the
COURTYARD OF CAMALDOLI
ancient courtyard. We wandered into the roomy church. One of the old
monks had died that afternoon, and prayers were being offered for his
salvation. We met the bier as it was carried out from the church.
Like other monasteries, Camaldoli has experienced many vicissitudes in
times of war and in times of peace. Throughout the Middle Ages it
remained a famous goal for pilgrimages, and its woodland air and mountain
freshness made it a favourite health resort. The converts to the order were at
first devoted to outdoor pursuits—the hermits in their little gardens tended
plants that were used for making drugs, and the monks were devoted to the
culture of the forests. Later, they contracted a taste for learning, and a
famous library was collected, chiefly by Ambrogio Traversari, who took an
important place in the early Italian Renaissance. Of this intellectual life no
trace remains. The books were scattered at the beginning of this century.
Some are at Poppi, others are at Florence, and the love of letters is dead.
But with the older achievements time has dealt more sparingly. A pharmacy
still makes part of the settlement, and the surrounding forest retains the
fame of being one of the finest in Europe. When the Government
appropriated Camaldoli, the traditions of the monks regarding the
cultivation of the trees were carried on, and Vallombrosa, the monastery on
the further side of the Pratomagno, was turned into a school of forestry. All
the forests throughout the district were placed under its care, and thus the
great fir trees, the abete of Camaldoli, its chestnut groves, and its beech and
oak forests have preserved some of their old grandeur.
LANDMARK OF
CAMALDOLI