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

Java: A Beginner's Guide: Create, Compile, and Run Java Programs Today Herbert Schildt 2024 scribd download

Today

Uploaded by

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

Java: A Beginner's Guide: Create, Compile, and Run Java Programs Today Herbert Schildt 2024 scribd download

Today

Uploaded by

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

Download Full Version ebook - Visit ebookmeta.

com

Java: A Beginner's Guide: Create, Compile, and Run


Java Programs Today Herbert Schildt

https://ebookmeta.com/product/java-a-beginners-guide-create-
compile-and-run-java-programs-today-herbert-schildt/

OR CLICK HERE

DOWLOAD NOW

Discover More Ebook - Explore Now at ebookmeta.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

Java: The Complete Reference Herbert Schildt

https://ebookmeta.com/product/java-the-complete-reference-herbert-
schildt/

ebookmeta.com

Primary Mathematics 3A Hoerst

https://ebookmeta.com/product/primary-mathematics-3a-hoerst/

ebookmeta.com

Java: The Complete Reference, Twelfth Edition Schildt

https://ebookmeta.com/product/java-the-complete-reference-twelfth-
edition-schildt/

ebookmeta.com

One Kill Dark Seductive Romance The Reapers Book 1 N O One

https://ebookmeta.com/product/one-kill-dark-seductive-romance-the-
reapers-book-1-n-o-one/

ebookmeta.com
Pretty Ruthless Brighton High School Reunion 1 1st Edition
Em Torrey

https://ebookmeta.com/product/pretty-ruthless-brighton-high-school-
reunion-1-1st-edition-em-torrey/

ebookmeta.com

Migrants and Machine Politics How India s Urban Poor Seek


Representation and Responsiveness 1st Edition Adam Michael
Auerbach
https://ebookmeta.com/product/migrants-and-machine-politics-how-india-
s-urban-poor-seek-representation-and-responsiveness-1st-edition-adam-
michael-auerbach/
ebookmeta.com

True North Leading Authentically in Today s Workplace


Emerging Leader Edition 3rd Edition Bill George & Zach
Clayton
https://ebookmeta.com/product/true-north-leading-authentically-in-
today-s-workplace-emerging-leader-edition-3rd-edition-bill-george-
zach-clayton/
ebookmeta.com

You're the One that I Want 1st Edition Simon James Green

https://ebookmeta.com/product/youre-the-one-that-i-want-1st-edition-
simon-james-green/

ebookmeta.com

Flight Mechanics Modeling and Analysis 2nd Edition


Jitendra R. Raol

https://ebookmeta.com/product/flight-mechanics-modeling-and-
analysis-2nd-edition-jitendra-r-raol/

ebookmeta.com
The Reign of Speech: On Applied Lacanian Psychoanalysis
1st Edition Dries G. M. Dulsster

https://ebookmeta.com/product/the-reign-of-speech-on-applied-lacanian-
psychoanalysis-1st-edition-dries-g-m-dulsster/

ebookmeta.com
BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter
Blind Folio: i

Java ™

A Beginner’s Guide

Ninth Edition

00-FM.indd 1 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter
Blind Folio: ii

About the Author


Best-selling author Herbert Schildt has written extensively
about programming for over three decades and is a leading
authority on the Java language. Called “one of the world’s
foremost authors of books about programming” by
International Developer magazine, his books have sold millions
of copies worldwide and have been translated into all major
foreign languages. He is the author of numerous books on Java,
including Java: The Complete Reference; Herb Schildt’s Java
Programming Cookbook; Introducing JavaFX 8 Programming;
and Swing: A Beginner’s Guide. He has also written extensively
about C, C++, and C#. Featured as one of the rock star
programmers in Ed Burns’ book Secrets of the Rock Star
Programmers: Riding the IT Crest, Schildt is interested in
all facets of computing, but his primary focus is computer
languages. Schildt holds both BA and MCS degrees from the
University of Illinois. His website is www.HerbSchildt.com.

About the Technical Editor


Dr. Danny Coward has worked on all editions of the Java
platform. He led the definition of Java Servlets into the first
version of the Java EE platform and beyond, web services
into the Java ME platform, and the strategy and planning for
Java SE 7. He founded JavaFX technology and, most recently,
designed the largest addition to the Java EE 7 standard, the
Java WebSocket API. From coding in Java, to designing
APIs with industry experts, to serving for several years as an
executive to the Java Community Process, he has a uniquely
broad perspective into multiple aspects of Java technology. In
addition, he is the author of two books on Java programming:
Java WebSocket Programming and Java EE 7: The Big Picture.
Most recently, he has been applying his knowledge of Java
to helping scale massive Java-based services for one of the
world’s most successful software companies. Dr. Coward holds
a bachelor’s, master’s, and doctorate in mathematics from the
University of Oxford.

00-FM.indd 2 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter
Blind Folio: iii

Java ™

A Beginner’s Guide

Ninth Edition
Herbert Schildt

New York Chicago San Francisco


Athens London Madrid Mexico City
Milan New Delhi Singapore Sydney Toronto

00-FM.indd 3 12/11/21 9:20 PM


Copyright © 2022 by McGraw Hill. All rights reserved. Except as permitted under the United States Copyright Act of 1976, no
part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval sys-
tem, without the prior written permission of the publisher, with the exception that the program listings may be entered, stored,
and executed in a computer system, but they may not be reproduced for publication.

ISBN: 978-1-26-046356-9
MHID: 1-26-046356-7

The material in this eBook also appears in the print version of this title: ISBN: 978-1-26-046355-2,
MHID: 1-26-046355-9.

eBook conversion by codeMantra


Version 1.0

All trademarks are trademarks of their respective owners. Rather than put a trademark symbol after every occurrence of a
trademarked name, we use names in an editorial fashion only, and to the benefit of the trademark owner, with no intention of
infringement of the trademark. Where such designations appear in this book, they have been printed with initial caps.

McGraw-Hill Education eBooks are available at special quantity discounts to use as premiums and sales promotions or for
use in corporate training programs. To contact a representative, please visit the Contact Us page at www.mhprofessional.com.

Information has been obtained by McGraw Hill from sources believed to be reliable. However, because of the possibility of
human or mechanical error by our sources, McGraw Hill, or others, McGraw Hill does not guarantee the accuracy, adequacy,
or completeness of any information and is not responsible for any errors or omissions or the results obtained from the use of
such information.

Oracle Corporation does not make any representations or warranties as to the accuracy, adequacy, or completeness of any in-
formation contained in this Work, and is not responsible for any errors or omissions.

TERMS OF USE

This is a copyrighted work and McGraw-Hill Education and its licensors reserve all rights in and to the work. Use of this work
is subject to these terms. Except as permitted under the Copyright Act of 1976 and the right to store and retrieve one copy of the
work, you may not decompile, disassemble, reverse engineer, reproduce, modify, create derivative works based upon, transmit,
distribute, disseminate, sell, publish or sublicense the work or any part of it without McGraw-Hill Education’s prior consent.
You may use the work for your own noncommercial and personal use; any other use of the work is strictly prohibited. Your
right to use the work may be terminated if you fail to comply with these terms.

THE WORK IS PROVIDED “AS IS.” McGRAW-HILL EDUCATION AND ITS LICENSORS MAKE NO GUARANTEES
OR WARRANTIES AS TO THE ACCURACY, ADEQUACY OR COMPLETENESS OF OR RESULTS TO BE OBTAINED
FROM USING THE WORK, INCLUDING ANY INFORMATION THAT CAN BE ACCESSED THROUGH THE WORK
VIA HYPERLINK OR OTHERWISE, AND EXPRESSLY DISCLAIM ANY WARRANTY, EXPRESS OR IMPLIED, IN-
CLUDING BUT NOT LIMITED TO IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICU-
LAR PURPOSE. McGraw-Hill Education and its licensors do not warrant or guarantee that the functions contained in the
work will meet your requirements or that its operation will be uninterrupted or error free. Neither McGraw-Hill Education
nor its licensors shall be liable to you or anyone else for any inaccuracy, error or omission, regardless of cause, in the work
or for any damages resulting therefrom. McGraw-Hill Education has no responsibility for the content of any information ac-
cessed through the work. Under no circumstances shall McGraw-Hill Education and/or its licensors be liable for any indirect,
incidental, special, punitive, consequential or similar damages that result from the use of or inability to use the work, even if
any of them has been advised of the possibility of such damages. This limitation of liability shall apply to any claim or cause
whatsoever whether such claim or cause arises in contract, tort or otherwise.
BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii

1 Java Fundamentals ........................................................................................... 1


The History and Philosophy of Java ................................................................................ 3
The Origins of Java ................................................................................................ 3
Java’s Lineage: C and C++ .................................................................................... 4
How Java Impacted the Internet ............................................................................ 4
Java’s Magic: The Bytecode .................................................................................. 6
Moving Beyond Applets ........................................................................................ 8
A Faster Release Schedule ..................................................................................... 8
The Java Buzzwords .............................................................................................. 9
Object-Oriented Programming ........................................................................................ 10
Encapsulation ......................................................................................................... 11
Polymorphism ........................................................................................................ 11
Inheritance ............................................................................................................. 12
The Java Development Kit .............................................................................................. 12
A First Simple Program ................................................................................................... 13
Entering the Program ............................................................................................. 14
Compiling the Program .......................................................................................... 14
The First Sample Program Line by Line ............................................................... 15

00-FM.indd 5 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

vi Java: A Beginner’s Guide

Handling Syntax Errors ................................................................................................... 17


A Second Simple Program .............................................................................................. 18
Another Data Type .......................................................................................................... 20
Try This 1-1: Converting Gallons to Liters ..................................................................... 21
Two Control Statements .................................................................................................. 22
The if Statement ..................................................................................................... 23
The for Loop .......................................................................................................... 24
Create Blocks of Code ..................................................................................................... 26
Semicolons and Positioning ............................................................................................ 27
Indentation Practices ....................................................................................................... 28
Try This 1-2: Improving the Gallons-to-Liters Converter ............................................... 28
The Java Keywords .......................................................................................................... 29
Identifiers in Java ............................................................................................................. 30
The Java Class Libraries .................................................................................................. 31
Chapter 1 Self Test .......................................................................................................... 31
2 Introducing Data Types and Operators ......................................................... 33
Why Data Types Are Important ....................................................................................... 34
Java’s Primitive Types ..................................................................................................... 34
Integers .................................................................................................................. 35
Floating-Point Types .............................................................................................. 37
Characters .............................................................................................................. 37
The Boolean Type ............................................................................................................ 39
Try This 2-1: How Far Away Is the Lightning? ............................................................... 40
Literals ............................................................................................................................. 41
Hexadecimal, Octal, and Binary Literals ............................................................... 42
Character Escape Sequences .................................................................................. 42
String Literals ........................................................................................................ 43
A Closer Look at Variables .............................................................................................. 44
Initializing a Variable ............................................................................................. 44
Dynamic Initialization ........................................................................................... 45
The Scope and Lifetime of Variables .............................................................................. 45
Operators ......................................................................................................................... 48
Arithmetic Operators ....................................................................................................... 48
Increment and Decrement ...................................................................................... 49
Relational and Logical Operators .................................................................................... 50
Short-Circuit Logical Operators ...................................................................................... 52
The Assignment Operator ................................................................................................ 53
Shorthand Assignments ................................................................................................... 53
Type Conversion in Assignments .................................................................................... 55
Casting Incompatible Types ............................................................................................ 56
Operator Precedence ....................................................................................................... 58
Try This 2-2: Display a Truth Table for the Logical Operators ....................................... 59

00-FM.indd 6 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents vii

Expressions ...................................................................................................................... 60
Type Conversion in Expressions ............................................................................ 60
Spacing and Parentheses ........................................................................................ 62
Chapter 2 Self Test .......................................................................................................... 62
3 Program Control Statements .......................................................................... 65
Input Characters from the Keyboard ............................................................................... 66
The if Statement .............................................................................................................. 67
Nested ifs ......................................................................................................................... 69
The if-else-if Ladder ........................................................................................................ 70
The Traditional switch Statement .................................................................................... 71
Nested switch Statements ................................................................................................ 75
Try This 3-1: Start Building a Java Help System ............................................................ 75
The for Loop .................................................................................................................... 77
Some Variations on the for Loop ..................................................................................... 79
Missing Pieces ................................................................................................................. 80
The Infinite Loop ................................................................................................... 81
Loops with No Body ....................................................................................................... 81
Declaring Loop Control Variables Inside the for Loop ................................................... 82
The Enhanced for Loop ................................................................................................... 83
The while Loop ............................................................................................................... 83
The do-while Loop .......................................................................................................... 85
Try This 3-2: Improve the Java Help System .................................................................. 87
Use break to Exit a Loop ................................................................................................. 90
Use break as a Form of goto ............................................................................................ 91
Use continue .................................................................................................................... 96
Try This 3-3: Finish the Java Help System ..................................................................... 97
Nested Loops ................................................................................................................... 101
Chapter 3 Self Test .......................................................................................................... 102
4 Introducing Classes, Objects, and Methods ................................................... 105
Class Fundamentals ......................................................................................................... 106
The General Form of a Class ................................................................................. 107
Defining a Class ..................................................................................................... 108
How Objects Are Created ................................................................................................ 110
Reference Variables and Assignment .............................................................................. 111
Methods ........................................................................................................................... 112
Adding a Method to the Vehicle Class ................................................................... 112
Returning from a Method ................................................................................................ 114
Returning a Value ............................................................................................................ 115
Using Parameters ............................................................................................................. 117
Adding a Parameterized Method to Vehicle .......................................................... 119
Try This 4-1: Creating a Help Class ................................................................................ 121

00-FM.indd 7 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

viii Java: A Beginner’s Guide

Constructors .................................................................................................................... 126


Parameterized Constructors ............................................................................................. 128
Adding a Constructor to the Vehicle Class ...................................................................... 128
The new Operator Revisited ............................................................................................ 130
Garbage Collection .......................................................................................................... 130
The this Keyword ............................................................................................................ 131
Chapter 4 Self Test .......................................................................................................... 133
5 More Data Types and Operators .................................................................... 135
Arrays .............................................................................................................................. 136
One-Dimensional Arrays ....................................................................................... 137
Try This 5-1: Sorting an Array ........................................................................................ 140
Multidimensional Arrays ................................................................................................. 142
Two-Dimensional Arrays ....................................................................................... 142
Irregular Arrays ...................................................................................................... 143
Arrays of Three or More Dimensions .................................................................... 144
Initializing Multidimensional Arrays ..................................................................... 144
Alternative Array Declaration Syntax ............................................................................. 145
Assigning Array References ............................................................................................ 146
Using the length Member ................................................................................................ 147
Try This 5-2: A Queue Class ........................................................................................... 149
The For-Each Style for Loop ........................................................................................... 153
Iterating Over Multidimensional Arrays ................................................................ 156
Applying the Enhanced for .................................................................................... 157
Strings .............................................................................................................................. 158
Constructing Strings .............................................................................................. 159
Operating on Strings .............................................................................................. 160
Arrays of Strings .................................................................................................... 162
Strings Are Immutable ........................................................................................... 162
Using a String to Control a switch Statement ........................................................ 163
Using Command-Line Arguments ................................................................................... 166
Using Type Inference with Local Variables ..................................................................... 167
Local Variable Type Inference with Reference Types ........................................... 169
Using Local Variable Type Inference in a for Loop ............................................... 171
Some var Restrictions ............................................................................................ 171
The Bitwise Operators ..................................................................................................... 172
The Bitwise AND, OR, XOR, and NOT Operators ............................................... 173
The Shift Operators ................................................................................................ 177
Bitwise Shorthand Assignments ............................................................................ 179
Try This 5-3: A ShowBits Class ...................................................................................... 180
The ? Operator ................................................................................................................. 182
Chapter 5 Self Test .......................................................................................................... 184

00-FM.indd 8 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents ix

6 A Closer Look at Methods and Classes .......................................................... 187


Controlling Access to Class Members ............................................................................ 188
Java’s Access Modifiers ......................................................................................... 189
Try This 6-1: Improving the Queue Class ....................................................................... 193
Pass Objects to Methods .................................................................................................. 194
How Arguments Are Passed ................................................................................... 196
Returning Objects ............................................................................................................ 198
Method Overloading ........................................................................................................ 200
Overloading Constructors ................................................................................................ 205
Try This 6-2: Overloading the Queue Constructor .......................................................... 207
Recursion ......................................................................................................................... 210
Understanding static ........................................................................................................ 212
Static Blocks .......................................................................................................... 215
Try This 6-3: The Quicksort ............................................................................................ 216
Introducing Nested and Inner Classes ............................................................................. 219
Varargs: Variable-Length Arguments .............................................................................. 222
Varargs Basics ........................................................................................................ 223
Overloading Varargs Methods ............................................................................... 226
Varargs and Ambiguity .......................................................................................... 227
Chapter 6 Self Test .......................................................................................................... 228
7 Inheritance ........................................................................................................ 231
Inheritance Basics ........................................................................................................... 232
Member Access and Inheritance ..................................................................................... 235
Constructors and Inheritance ........................................................................................... 238
Using super to Call Superclass Constructors .................................................................. 240
Using super to Access Superclass Members ................................................................... 244
Try This 7-1: Extending the Vehicle Class ...................................................................... 245
Creating a Multilevel Hierarchy ...................................................................................... 248
When Are Constructors Executed? .................................................................................. 250
Superclass References and Subclass Objects .................................................................. 252
Method Overriding .......................................................................................................... 256
Overridden Methods Support Polymorphism .................................................................. 259
Why Overridden Methods? ............................................................................................. 261
Applying Method Overriding to TwoDShape ........................................................ 261
Using Abstract Classes .................................................................................................... 265
Using final ....................................................................................................................... 269
final Prevents Overriding ....................................................................................... 269
final Prevents Inheritance ...................................................................................... 269
Using final with Data Members ............................................................................. 270
The Object Class ............................................................................................................. 271
Chapter 7 Self Test .......................................................................................................... 272

00-FM.indd 9 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

x Java: A Beginner’s Guide

8 Packages and Interfaces .................................................................................. 275


Packages .......................................................................................................................... 276
Defining a Package ................................................................................................ 277
Finding Packages and CLASSPATH ..................................................................... 278
A Short Package Example ..................................................................................... 278
Packages and Member Access ......................................................................................... 280
A Package Access Example ................................................................................... 281
Understanding Protected Members ................................................................................. 282
Importing Packages ......................................................................................................... 284
Java’s Class Library Is Contained in Packages ............................................................... 286
Interfaces ......................................................................................................................... 286
Implementing Interfaces .................................................................................................. 287
Using Interface References ............................................................................................. 291
Try This 8-1: Creating a Queue Interface ........................................................................ 293
Variables in Interfaces ..................................................................................................... 298
Interfaces Can Be Extended ............................................................................................ 299
Default Interface Methods ............................................................................................... 300
Default Method Fundamentals .............................................................................. 301
A More Practical Example of a Default Method ................................................... 303
Multiple Inheritance Issues .................................................................................... 304
Use static Methods in an Interface .................................................................................. 305
Private Interface Methods ................................................................................................ 306
Final Thoughts on Packages and Interfaces .................................................................... 307
Chapter 8 Self Test .......................................................................................................... 307
9 Exception Handling .......................................................................................... 309
The Exception Hierarchy ................................................................................................ 311
Exception Handling Fundamentals ................................................................................. 311
Using try and catch ................................................................................................ 312
A Simple Exception Example ................................................................................ 312
The Consequences of an Uncaught Exception ................................................................ 314
Exceptions Enable You to Handle Errors Gracefully ............................................. 316
Using Multiple catch Statements ..................................................................................... 317
Catching Subclass Exceptions ......................................................................................... 318
Try Blocks Can Be Nested .............................................................................................. 319
Throwing an Exception ................................................................................................... 320
Rethrowing an Exception ....................................................................................... 321
A Closer Look at Throwable ........................................................................................... 322
Using finally .................................................................................................................... 324
Using throws .................................................................................................................... 326
Three Additional Exception Features .............................................................................. 327
Java’s Built-in Exceptions ............................................................................................... 329
Creating Exception Subclasses ........................................................................................ 331
Try This 9-1: Adding Exceptions to the Queue Class ..................................................... 333
Chapter 9 Self Test .......................................................................................................... 337

00-FM.indd 10 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents xi

10 Using I/O ........................................................................................................... 339


Java’s I/O Is Built upon Streams ..................................................................................... 341
Byte Streams and Character Streams .............................................................................. 341
The Byte Stream Classes ................................................................................................. 341
The Character Stream Classes ......................................................................................... 342
The Predefined Streams ................................................................................................... 343
Using the Byte Streams ................................................................................................... 344
Reading Console Input .......................................................................................... 345
Writing Console Output ......................................................................................... 346
Reading and Writing Files Using Byte Streams .............................................................. 347
Inputting from a File .............................................................................................. 347
Writing to a File ..................................................................................................... 351
Automatically Closing a File ........................................................................................... 353
Reading and Writing Binary Data ................................................................................... 356
Try This 10-1: A File Comparison Utility ....................................................................... 359
Random-Access Files ...................................................................................................... 360
Using Java’s Character-Based Streams ........................................................................... 362
Console Input Using Character Streams ................................................................ 364
Console Output Using Character Streams ............................................................. 368
File I/O Using Character Streams ................................................................................... 369
Using a FileWriter ................................................................................................. 369
Using a FileReader ................................................................................................ 370
Using Java’s Type Wrappers to Convert Numeric Strings .............................................. 372
Try This 10-2: Creating a Disk-Based Help System ....................................................... 374
Chapter 10 Self Test ........................................................................................................ 381
11 Multithreaded Programming .......................................................................... 383
Multithreading Fundamentals ......................................................................................... 384
The Thread Class and Runnable Interface ...................................................................... 385
Creating a Thread ............................................................................................................ 386
One Improvement and Two Simple Variations ...................................................... 389
Try This 11-1: Extending Thread .................................................................................... 393
Creating Multiple Threads ............................................................................................... 396
Determining When a Thread Ends .................................................................................. 399
Thread Priorities .............................................................................................................. 402
Synchronization ............................................................................................................... 406
Using Synchronized Methods ......................................................................................... 406
The synchronized Statement ........................................................................................... 409
Thread Communication Using notify( ), wait( ), and notifyAll( ) .................................. 412
An Example That Uses wait( ) and notify( ) .......................................................... 413
Suspending, Resuming, and Stopping Threads ............................................................... 418
Try This 11-2: Using the Main Thread ............................................................................ 422
Chapter 11 Self Test ........................................................................................................ 424

00-FM.indd 11 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xii Java: A Beginner’s Guide

12 Enumerations, Autoboxing, Annotations, and More ..................................... 425


Enumerations ................................................................................................................... 426
Enumeration Fundamentals ................................................................................... 427
Java Enumerations Are Class Types ................................................................................ 429
The values( ) and valueOf( ) Methods ............................................................................. 429
Constructors, Methods, Instance Variables, and Enumerations ...................................... 431
Two Important Restrictions ................................................................................... 433
Enumerations Inherit Enum ............................................................................................ 433
Try This 12-1: A Computer-Controlled Traffic Light ..................................................... 435
Autoboxing ...................................................................................................................... 440
Type Wrappers ................................................................................................................. 440
Autoboxing Fundamentals .............................................................................................. 442
Autoboxing and Methods ................................................................................................ 443
Autoboxing/Unboxing Occurs in Expressions ................................................................ 445
A Word of Warning ................................................................................................ 446
Static Import .................................................................................................................... 447
Annotations (Metadata) ................................................................................................... 450
Introducing instanceof ..................................................................................................... 453
Chapter 12 Self Test ........................................................................................................ 455
13 Generics ............................................................................................................. 457
Generics Fundamentals ................................................................................................... 458
A Simple Generics Example ........................................................................................... 459
Generics Work Only with Reference Types ........................................................... 463
Generic Types Differ Based on Their Type Arguments ......................................... 463
A Generic Class with Two Type Parameters .......................................................... 464
The General Form of a Generic Class ................................................................... 465
Bounded Types ................................................................................................................ 466
Using Wildcard Arguments ............................................................................................. 469
Bounded Wildcards ......................................................................................................... 472
Generic Methods ............................................................................................................. 475
Generic Constructors ....................................................................................................... 477
Generic Interfaces ............................................................................................................ 478
Try This 13-1: Create a Generic Queue .......................................................................... 480
Raw Types and Legacy Code .......................................................................................... 485
Type Inference with the Diamond Operator .................................................................... 488
Local Variable Type Inference and Generics ................................................................... 489
Erasure ............................................................................................................................. 489
Ambiguity Errors ............................................................................................................. 490
Some Generic Restrictions .............................................................................................. 491
Type Parameters Can’t Be Instantiated .................................................................. 491
Restrictions on Static Members ............................................................................. 491
Generic Array Restrictions .................................................................................... 492
Generic Exception Restriction ............................................................................... 493

00-FM.indd 12 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents xiii

Continuing Your Study of Generics ................................................................................. 493


Chapter 13 Self Test ........................................................................................................ 493
14 Lambda Expressions and Method References ................................................ 495
Introducing Lambda Expressions .................................................................................... 496
Lambda Expression Fundamentals ........................................................................ 497
Functional Interfaces ............................................................................................. 498
Lambda Expressions in Action .............................................................................. 500
Block Lambda Expressions ............................................................................................. 505
Generic Functional Interfaces ......................................................................................... 506
Try This 14-1: Pass a Lambda Expression as an Argument ............................................ 508
Lambda Expressions and Variable Capture ..................................................................... 513
Throw an Exception from Within a Lambda Expression ................................................ 514
Method References .......................................................................................................... 516
Method References to static Methods .................................................................... 516
Method References to Instance Methods ............................................................... 518
Constructor References ................................................................................................... 522
Predefined Functional Interfaces ..................................................................................... 525
Chapter 14 Self Test ........................................................................................................ 527
15 Modules ............................................................................................................. 529
Module Basics ................................................................................................................. 531
A Simple Module Example ................................................................................... 532
Compile and Run the First Module Example ........................................................ 536
A Closer Look at requires and exports ................................................................. 537
java.base and the Platform Modules ................................................................................ 538
Legacy Code and the Unnamed Module ......................................................................... 540
Exporting to a Specific Module ....................................................................................... 541
Using requires transitive .................................................................................................. 542
Try This 15-1: Experiment with requires transitive ........................................................ 543
Use Services .................................................................................................................... 546
Service and Service Provider Basics ..................................................................... 547
The Service-Based Keywords ................................................................................ 548
A Module-Based Service Example ........................................................................ 548
Additional Module Features ............................................................................................ 555
Open Modules ........................................................................................................ 555
The opens Statement .............................................................................................. 556
requires static ......................................................................................................... 556
Continuing Your Study of Modules ................................................................................. 556
Chapter 15 Self Test ........................................................................................................ 557
16 Switch Expressions, Records, and Other Recently Added Features ........... 559
Enhancements to switch .................................................................................................. 561
Use a List of case Constants .................................................................................. 563
Introducing the switch Expression and the yield Statement .................................. 563

00-FM.indd 13 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xiv Java: A Beginner’s Guide

Introducing the Arrow in a case Statement ............................................................ 565


A Closer Look at the Arrow case ........................................................................... 567
Try This 16-1: Use a switch Expression to Obtain a City’s Time Zone .......................... 571
Records ............................................................................................................................ 573
Record Basics ........................................................................................................ 574
Create Record Constructors ................................................................................... 576
A Closer Look at Record Getter Methods ............................................................. 581
Pattern Matching with instanceof .................................................................................... 581
Sealed Classes and Interfaces .......................................................................................... 583
Sealed Classes ........................................................................................................ 583
Sealed Interfaces .................................................................................................... 586
Future Directions ............................................................................................................. 587
Chapter 16 Self Test ........................................................................................................ 588
17 Introducing Swing ............................................................................................ 591
The Origins and Design Philosophy of Swing ................................................................ 593
Components and Containers ............................................................................................ 595
Components ........................................................................................................... 595
Containers .............................................................................................................. 596
The Top-Level Container Panes ............................................................................. 596
Layout Managers ............................................................................................................. 597
A First Simple Swing Program ....................................................................................... 597
The First Swing Example Line by Line ................................................................. 599
Swing Event Handling ..................................................................................................... 602
Events .................................................................................................................... 603
Event Sources ........................................................................................................ 603
Event Listeners ...................................................................................................... 603
Event Classes and Listener Interfaces ................................................................... 604
Use JButton ..................................................................................................................... 604
Work with JTextField ...................................................................................................... 608
Create a JCheckBox ........................................................................................................ 611
Work with JList ............................................................................................................... 615
Try This 17-1: A Swing-Based File Comparison Utility ................................................. 619
Use Anonymous Inner Classes or Lambda Expressions to Handle Events ..................... 624
Chapter 17 Self Test ................................................................................................... 626
A Answers to Self Tests ........................................................................................ 627
Chapter 1: Java Fundamentals ......................................................................................... 628
Chapter 2: Introducing Data Types and Operators .......................................................... 630
Chapter 3: Program Control Statements .......................................................................... 631
Chapter 4: Introducing Classes, Objects, and Methods .................................................. 634
Chapter 5: More Data Types and Operators .................................................................... 635
Chapter 6: A Closer Look at Methods and Classes ......................................................... 640
Chapter 7: Inheritance ..................................................................................................... 645

00-FM.indd 14 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Contents xv

Chapter 8: Packages and Interfaces ................................................................................. 647


Chapter 9: Exception Handling ....................................................................................... 649
Chapter 10: Using I/O ..................................................................................................... 652
Chapter 11: Multithreaded Programming ....................................................................... 656
Chapter 12: Enumerations, Autoboxing, Annotations, and More ................................... 658
Chapter 13: Generics ....................................................................................................... 662
Chapter 14: Lambda Expressions and Method References ............................................. 666
Chapter 15: Modules ....................................................................................................... 670
Chapter 16: Switch Expressions, Records, and Other Recently Added Features ........... 671
Chapter 17: Introducing Swing ....................................................................................... 675
B Using Java’s Documentation Comments ........................................................ 683
The javadoc Tags ............................................................................................................. 684
@author ................................................................................................................. 685
{@code} ................................................................................................................ 685
@deprecated .......................................................................................................... 685
{@docRoot} .......................................................................................................... 685
@exception ............................................................................................................ 686
@hidden ................................................................................................................. 686
{@index} ............................................................................................................... 686
{@inheritDoc} ....................................................................................................... 686
{@link} .................................................................................................................. 686
{@linkplain} .......................................................................................................... 687
{@literal} .............................................................................................................. 687
@param .................................................................................................................. 687
@provides .............................................................................................................. 687
@return .................................................................................................................. 687
@see ....................................................................................................................... 687
@since ................................................................................................................... 688
{@summary} ......................................................................................................... 688
@throws ................................................................................................................. 688
@uses ..................................................................................................................... 688
{@value} ............................................................................................................... 688
@version ................................................................................................................ 689
The General Form of a Documentation Comment .......................................................... 689
What javadoc Outputs ..................................................................................................... 689
An Example That Uses Documentation Comments ........................................................ 689
C Compile and Run Simple Single-File Programs in One Step ....................... 691
D Introducing JShell ............................................................................................ 693
JShell Basics .................................................................................................................... 694
List, Edit, and Rerun Code .............................................................................................. 696
Add a Method .................................................................................................................. 697
Create a Class .................................................................................................................. 698

00-FM.indd 15 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xvi Java: A Beginner’s Guide

Use an Interface ............................................................................................................... 699


Evaluate Expressions and Use Built-in Variables ............................................................ 700
Importing Packages ......................................................................................................... 701
Exceptions ....................................................................................................................... 702
Some More JShell Commands ........................................................................................ 702
Exploring JShell Further ................................................................................................. 703
E More Java Keywords ........................................................................................ 705
The transient and volatile Modifiers ................................................................................ 706
strictfp .............................................................................................................................. 706
assert ................................................................................................................................ 707
Native Methods ............................................................................................................... 708
Another Form of this ....................................................................................................... 708

Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711

00-FM.indd 16 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Introduction
T he purpose of this book is to teach you the fundamentals of Java programming. It uses
a step-by-step approach complete with numerous examples, self tests, and projects. It
assumes no previous programming experience. The book starts with the basics, such as how
to compile and run a Java program. It then discusses the keywords, features, and constructs
that form the core of the Java language. You’ll also find coverage of some of Java’s most
advanced features, including multithreaded programming, generics, lambda expressions,
records, and modules. An introduction to the fundamentals of Swing concludes the book.
By the time you finish, you will have a firm grasp of the essentials of Java programming.
It is important to state at the outset that this book is just a starting point. Java is more than
just the elements that define the language. Java also includes extensive libraries and tools that
aid in the development of programs. To be a top-notch Java programmer implies mastery of
these areas, too. After completing this book, you will have the knowledge to pursue any and all
other aspects of Java.

The Evolution of Java


Only a few languages have fundamentally reshaped the very essence of programming. In this
elite group, one stands out because its impact was both rapid and widespread. This language
is, of course, Java. It is not an overstatement to say that the original release of Java 1.0 in 1995
by Sun Microsystems, Inc., caused a revolution in programming. This revolution radically
transformed the Web into a highly interactive environment. In the process, Java set a new
standard in computer language design.

xvii

00-FM.indd 17 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xviii Java: A Beginner’s Guide

Over the years, Java has continued to grow, evolve, and otherwise redefine itself. Unlike
many other languages, which are slow to incorporate new features, Java has often been at the
forefront of computer language development. One reason for this is the culture of innovation
and change that came to surround Java. As a result, Java has gone through several upgrades—
some relatively small, others more significant.
The first major update to Java was version 1.1. The features added by Java 1.1 were
more substantial than the increase in the minor revision number would have you think.
For example, Java 1.1 added many new library elements, redefined the way events are
handled, and reconfigured many features of the original 1.0 library.
The next major release of Java was Java 2, where the 2 indicates “second generation.”
The creation of Java 2 was a watershed event, marking the beginning of Java’s “modern
age.” The first release of Java 2 carried the version number 1.2. It may seem odd that the first
release of Java 2 used the 1.2 version number. The reason is that it originally referred to the
internal version number of the Java libraries but then was generalized to refer to the entire
release itself. With Java 2, Sun repackaged the Java product as J2SE (Java 2 Platform Standard
Edition), and the version numbers began to be applied to that product.
The next upgrade of Java was J2SE 1.3. This version of Java was the first major upgrade to
the original Java 2 release. For the most part, it added to existing functionality and “tightened
up” the development environment. The release of J2SE 1.4 further enhanced Java. This release
contained several important new features, including chained exceptions, channel-based I/O,
and the assert keyword.
The release of J2SE 5 created nothing short of a second Java revolution. Unlike most of
the previous Java upgrades, which offered important but incremental improvements, J2SE 5
fundamentally expanded the scope, power, and range of the language. To give you an idea of
the magnitude of the changes caused by J2SE 5, here is a list of its major new features:

● Generics
● Autoboxing/unboxing
● Enumerations
● The enhanced “for-each” style for loop
● Variable-length arguments (varargs)
● Static import
● Annotations

This is not a list of minor tweaks or incremental upgrades. Each item in the list represents a
significant addition to the Java language. Some, such as generics, the enhanced for loop, and
varargs, introduced new syntax elements. Others, such as autoboxing and auto-unboxing, altered
the semantics of the language. Annotations added an entirely new dimension to programming.
The importance of these new features is reflected in the use of the version number “5.”
The next version number for Java would normally have been 1.5. However, the new features
were so significant that a shift from 1.4 to 1.5 just didn’t seem to express the magnitude of the
change. Instead, Sun elected to increase the version number to 5 as a way of emphasizing that

00-FM.indd 18 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Introduction xix

a major event was taking place. Thus, it was named J2SE 5, and the Java Development Kit
(JDK) was called JDK 5. In order to maintain consistency, however, Sun decided to use 1.5 as
its internal version number, which is also referred to as the developer version number. The “5”
in J2SE 5 is called the product version number.
The next release of Java was called Java SE 6, and Sun once again decided to change the
name of the Java platform. First, notice that the “2” has been dropped. Thus, the platform now
had the name Java SE, and the official product name was Java Platform, Standard Edition 6,
with the development kit being called JDK 6. As with J2SE 5, the 6 in Java SE 6 is the product
version number. The internal, developer version number is 1.6.
Java SE 6 built on the base of J2SE 5, adding incremental improvements. Java SE 6 added
no major features to the Java language proper, but it did enhance the API libraries, added several
new packages, and offered improvements to the run time. It also went through several updates
during its long (in Java terms) life cycle, with several upgrades added along the way. In general,
Java SE 6 served to further solidify the advances made by J2SE 5.
The next release of Java was called Java SE 7, with the development kit being called JDK 7.
It has an internal version number of 1.7. Java SE 7 was the first major release of Java after Sun
Microsystems was acquired by Oracle. Java SE 7 added several new features, including significant
additions to the language and the API libraries. Some of the most important features added by Java
SE 7 were those developed as part of Project Coin. The purpose of Project Coin was to identify a
number of small changes to the Java language that would be incorporated into JDK 7, including

● A String can control a switch statement.


● Binary integer literals.
● Underscores in numeric literals.
● An expanded try statement, called try-with-resources, that supports automatic resource
management.
● Type inference (via the diamond operator) when constructing a generic instance.
● Enhanced exception handling in which two or more exceptions can be caught by a single
catch (multicatch) and better type checking for exceptions that are rethrown.

As you can see, even though the Project Coin features were considered to be small changes
to the language, their benefits were much larger than the qualifier “small” would suggest.
In particular, the try-with-resources statement profoundly affects the way that a substantial
amount of code is written.
The next release of Java was Java SE 8, with the development kit being called JDK 8.
It has an internal version number of 1.8. JDK 8 represented a very significant upgrade to
the Java language because of the inclusion of a far-reaching new language feature: the lambda
expression. The impact of lambda expressions was, and continues to be, quite profound,
changing both the way that programming solutions are conceptualized and how Java code
is written. In the process, lambda expressions can simplify and reduce the amount of source
code needed to create certain constructs. The addition of lambda expressions also caused a
new operator (the –>) and a new syntax element to be added to the language. In addition to

00-FM.indd 19 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xx Java: A Beginner’s Guide

lambda expressions, JDK 8 added many other important new features. For example, beginning
with JDK 8, it is now possible to define a default implementation for a method specified by
an interface. In the final analysis, Java SE 8 was a major release that profoundly expanded the
capabilities of the language and changed the way that Java code is written.
The next release of Java was Java SE 9. The developer’s kit was called JDK 9. With the
release of JDK 9, the internal version number is also 9. JDK 9 represented a major Java release,
incorporating significant enhancements to both the Java language and its libraries. The primary
new feature was modules, which enable you to specify the relationships and dependencies of
the code that comprises an application. Modules also add another dimension to Java’s access
control features. The inclusion of modules caused a new syntax element, several new keywords,
and various tool enhancements to be added to Java. Modules had a profound effect on the API
library because, beginning with JDK 9, the library packages are now organized into modules.
In addition to modules, JDK 9 included several other new features. One of particular
interest is JShell, which is a tool that supports interactive program experimentation and
learning. (An introduction to JShell is found in Appendix D.) Another interesting upgrade is
support for private interface methods. Their inclusion further enhanced JDK 8’s support for
default methods in interfaces. JDK 9 added a search feature to the javadoc tool and a new tag
called @index to support it. As with previous releases, JDK 9 contains a number of updates
and enhancements to Java’s API libraries.
As a general rule, in any Java release, it is the new features that receive the most attention.
However, there is one high-profile aspect of Java that was deprecated by JDK 9: applets.
Beginning with JDK 9, applets are no longer recommended for new projects. As will be
explained in greater detail in Chapter 1, because of waning browser support for applets
(and other factors), JDK 9 deprecated the entire applet API.
The next release of Java was Java SE 10 (JDK 10). However, prior to its release, a major
change occurred in the Java release schedule. In the past, major releases were often separated
by two or more years. However, beginning with JDK 10, the time between releases was
significantly shortened. Releases are now expected to occur on a strict time-based schedule,
with the anticipated time between major releases (now called feature releases) to be just six
months. As a result, JDK 10 was released in March 2018, which is six months after the release
of JDK 9. This more rapid release cadence enables new features and improvements to be
quickly available to Java programmers. Instead of waiting two or more years, when a new
feature is ready, it becomes part of the next scheduled release.
Another facet of the changes to the Java release schedule is the long-term support (LTS)
release. It is now anticipated that an LTS release will take place every three years. An LTS
release will be supported (and thus remain viable) for a period of time longer than six months.
The first LTS release was JDK 11. The second LTS release was JDK 17, for which this book
has been updated. Because of the stability that an LTS release offers, it is likely that its feature
set will define a baseline of functionality for a number of years. Consult Oracle for the latest
information concerning long-term support and the LTS release schedule.
The primary new language feature added by JDK 10 was support for local variable
type inference. With local variable type inference, it is now possible to let the type of a
local variable be inferred from the type of its initializer, rather than being explicitly specified.

00-FM.indd 20 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Introduction xxi

To support this new capability, the context-sensitive keyword var was added to Java. Type
inference can streamline code by eliminating the need to redundantly specify a variable’s type
when it can be inferred from its initializer. It can also simplify declarations in cases in which
the type is difficult to discern or cannot be explicitly specified. Local variable type inference
has become a common part of the contemporary programming environment. Its inclusion in
Java helps keep Java up-to-date with evolving trends in language design. Along with a number
of other changes, JDK 10 also redefined the Java version string, changing the meaning of the
version numbers so they better align with the new time-based release schedule.
The next version of Java was Java SE 11 (JDK 11). It was released in September 2018,
which is six months after JDK 10. It was an LTS release. The primary new language feature
in JDK 11 was its support for the use of var in a lambda expression. Also, another execution
mode was added to the Java launcher that enables it to directly execute simple single-file
programs. JDK 11 also removed some features. Perhaps of greatest interest, because of its
historical significance, is the removal of support for applets. Recall that applets were first
deprecated by JDK 9. With the release of JDK 11, applet support has been removed. Support
for another deployment-related technology called Java Web Start was also removed from
JDK 11. There is one other high-profile removal in JDK 11: JavaFX. This GUI framework is
no longer part of the JDK, becoming a separate open-source project instead. Because these
features have been removed from the JDK, they are not discussed in this book.
Between the JDK 11 LTS and the next LTS release (JDK 17) were five feature releases:
JDK 12 through JDK 16. JDK 12 and JDK 13 did not add any new language features. JDK 14
added support for the switch expression, which is a switch that produces a value. Other
enhancements to switch were also included. Text blocks, which are essentially string literals
that can span more than one line, were added by JDK 15. JDK 16 enhanced instanceof with
pattern matching and added a new type of class called a record along with the new context-
sensitive keyword record. A record provides a convenient means of aggregating data. JDK 16
also supplied a new application packaging tool called jpackage.
At the time of this writing, Java SE 17 (JDK 17) is the latest version of Java. As mentioned,
it is the second LTS Java release. Thus, it is of particular importance. Its major new feature is
the ability to seal classes and interfaces. Sealing gives you control over the inheritance of a
class and the inheritance and implementation of an interface. Towards this end, it adds a new
context-sensitive keyword sealed. It also adds the context-sensitive keyword non-sealed, which
is the first hyphenated Java keyword. JDK 17 marks the applet API as deprecated for removal.
As explained, support of applets was removed several years ago. However, the applet API was
simply deprecated, which allowed vestigial code that relied on this API to still compile. With the
release of JDK 17, the applet API is now subject to removal by a future release.
One other point about the evolution of Java: Beginning in 2006, the process of open-
sourcing Java began. Today, open-source implementations of the JDK are available. Open
sourcing further contributes to the dynamic nature of Java development. In the final analysis,
Java’s legacy of innovation is secure. Java remains the vibrant, nimble language that the
programming world has come to expect.
The material in this book has been updated through JDK 17. As the preceding discussion
has highlighted, however, the history of Java programming is marked by dynamic change. As
you advance in your study of Java, you will want to watch for new features of each subsequent
Java release. Simply put: The evolution of Java continues!

00-FM.indd 21 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

xxii Java: A Beginner’s Guide

How This Book Is Organized


This book presents an evenly paced tutorial in which each section builds upon the previous
one. It contains 17 chapters, each discussing an aspect of Java. This book is unique because it
includes several special elements that reinforce what you are learning.

Key Skills & Concepts


Each chapter begins with a set of critical skills that you will be learning.

Self Test
Each chapter concludes with a Self Test that lets you test your knowledge. The answers are
in Appendix A.

Ask the Expert


Sprinkled throughout the book are special “Ask the Expert” boxes. These contain additional
information or interesting commentary about a topic. They use a question/answer format.

Try This Elements


Each chapter contains one or more Try This elements, which are projects that show you how to
apply what you are learning. In many cases, these are real-world examples that you can use as
starting points for your own programs.

No Previous Programming Experience Required


This book assumes no previous programming experience. Thus, if you have never programmed
before, you can use this book. If you do have some previous programming experience, you will
be able to advance a bit more quickly. Keep in mind, however, that Java differs in several key
ways from other popular computer languages. It is important not to jump to conclusions. Thus,
even for the experienced programmer, a careful reading is advised.

Required Software
To compile and run all of the programs in this book, you will need the latest Java Development Kit
(JDK), which, at the time of this writing, is JDK 17. This is the JDK for Java SE 17. Instructions
for obtaining the Java JDK are given in Chapter 1.
If you are using an earlier version of Java, you will still be able to use this book, but you
won’t be able to compile and run the programs that use Java’s newer features.

Don’t Forget: Code on the Web


Remember, the source code for all of the examples and projects in this book is available free of
charge on the Web at www.mhprofessional.com.

00-FM.indd 22 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter

Introduction xxiii

Special Thanks
Special thanks to Danny Coward, the technical editor for this edition of the book. Danny has
worked on several of my books, and his advice, insights, and suggestions have always been of
great value and much appreciated.

For Further Study


Java: A Beginner’s Guide is your gateway to the Herb Schildt series of Java programming
books. Here are some others that you will find of interest:

Java: The Complete Reference


Herb Schildt’s Java Programming Cookbook
The Art of Java
Swing: A Beginner’s Guide
Introducing JavaFX 8 Programming

00-FM.indd 23 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Front Matter
Blind Folio: xxiv

This page intentionally left blank

00-FM.indd 24 12/11/21 9:20 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Chapter 1
Blind Folio: 1

Chapter 1
Java Fundamentals

01-ch01.indd 1 12/11/21 9:21 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Chapter 1

2 Java: A Beginner’s Guide

Key Skills & Concepts


● Know the history and philosophy of Java
● Understand Java’s contribution to the Internet
● Understand the importance of bytecode
● Know the Java buzzwords
● Understand the foundational principles of object-oriented programming
● Create, compile, and run a simple Java program
● Use variables
● Use the if and for control statements
● Create blocks of code
● Understand how statements are positioned, indented, and terminated
● Know the Java keywords
● Understand the rules for Java identifiers

In computing, few technologies have had the impact of Java. Its creation in the early days of the
Web helped shape the modern form of the Internet, including both the client and server sides.
Its innovative features advanced the art and science of programming, setting a new standard in
computer language design. The forward-thinking culture that grew up around Java ensured it
would remain vibrant and alive, adapting to the often rapid and varied changes in the computing
landscape. Simply put: not only is Java one of the world’s most important computer languages,
it is a force that revolutionized programming and, in the process, changed the world.
Although Java is a language often associated with Internet programming, it is by no
means limited in that regard. Java is a powerful, full-featured, general-purpose programming
language. Thus, if you are new to programming, Java is an excellent language to learn.
Moreover, to be a professional programmer today implies the ability to program in Java—it
is that important. In the course of this book, you will learn the basic skills that will help you
master it.
The purpose of this chapter is to introduce you to Java, beginning with its history, its
design philosophy, and several of its most important features. By far, the hardest thing about
learning a programming language is the fact that no element exists in isolation. Instead, the
components of the language work in conjunction with each other. This interrelatedness is
especially pronounced in Java. In fact, it is difficult to discuss one aspect of Java without
involving others. To help overcome this problem, this chapter provides a brief overview

01-ch01.indd 2 12/11/21 9:21 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Chapter 1

Chapter 1: Java Fundamentals 3

of several Java features, including the general form of a Java program, some basic control
structures, and simple operators. It does not go into too many details, but, rather, concentrates
on general concepts common to any Java program.

The History and Philosophy of Java


Before one can fully appreciate the unique aspects of Java, it is necessary to understand the
forces that drove its creation, the programming philosophy that it embodies, and key concepts
of its design. As you advance through this book, you will see that many aspects of Java are
either a direct or indirect result of the historical forces that shaped the language. Thus, it
is fitting that we begin our examination of Java by exploring how Java relates to the larger
programming universe.

The Origins of Java


Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike
Sheridan at Sun Microsystems in 1991. This language was initially called “Oak” but was
renamed “Java” in 1995. Somewhat surprisingly, the original impetus for Java was not the
Internet! Instead, the primary motivation was the need for a platform-independent language
that could be used to create software to be embedded in various consumer electronic devices,
such as toasters, microwave ovens, and remote controls. As you can probably guess, many
different types of CPUs are used as controllers. The trouble was that (at the time) most
computer languages were designed to be compiled into machine code that was targeted for a
specific type of CPU. For example, consider the C++ language.
Although it was possible to compile a C++ program for just about any type of CPU, to do
so required a full C++ compiler targeted for that CPU. The problem, however, is that compilers
are expensive and time consuming to create. In an attempt to find a better solution, Gosling
and the others worked on a portable, cross-platform language that could produce code that
would run on a variety of CPUs under differing environments. This effort ultimately led to the
creation of Java.
About the time that the details of Java were being worked out, a second, and ultimately
more important, factor emerged that would play a crucial role in the future of Java. This
second force was, of course, the World Wide Web. Had the Web not taken shape at about the
same time that Java was being implemented, Java might have remained a useful but obscure
language for programming consumer electronics. However, with the emergence of the Web,
Java was propelled to the forefront of computer language design, because the Web, too,
demanded portable programs.
Most programmers learn early in their careers that portable programs are as elusive as they
are desirable. While the quest for a way to create efficient, portable (platform-independent)
programs is nearly as old as the discipline of programming itself, it had taken a back seat to
other, more pressing problems. However, with the advent of the Internet and the Web, the old
problem of portability returned with a vengeance. After all, the Internet consisted of a diverse,
distributed universe populated with many types of computers, operating systems, and CPUs.
What was once an irritating but low-priority problem had become a high-profile necessity.
By 1993 it became obvious to members of the Java design team that the problems of portability
frequently encountered when creating code for embedded controllers are also found when

01-ch01.indd 3 12/11/21 9:21 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Chapter 1

4 Java: A Beginner’s Guide

attempting to create code for the Internet. This realization caused the focus of Java to switch
from consumer electronics to Internet programming. So, although it was the desire for an
architecture-neutral programming language that provided the initial spark, it was the Internet
that ultimately led to Java’s large-scale success.

Java’s Lineage: C and C++


The history of computer languages is not one of isolated events. Rather, it is a continuum in
which each new language is influenced in one way or another by what has come before. In this
regard, Java is no exception. Before moving on, it is useful to understand where Java fits into
the family tree of computer languages.
The two languages that form Java’s closest ancestors are C and C++. As you may know,
C and C++ are among the most important computer languages ever invented and are still in
widespread use today. From C, Java inherits its syntax. Java’s object model is adapted from
C++. Java’s relationship to C and C++ is important for a number of reasons. First, at the time
of Java’s creation, many programmers were familiar with the C/C++ syntax. Because Java
uses a similar syntax, it was relatively easy for a C/C++ programmer to learn Java. This made
it possible for Java to be readily utilized by the pool of existing programmers, thus facilitating
Java’s acceptance by the programming community.
Second, Java’s designers did not “reinvent the wheel.” Instead, they further refined an
already highly successful programming paradigm. The modern age of programming began
with C. It moved to C++ and then to Java. By inheriting and building on that rich heritage,
Java provides a powerful, logically consistent programming environment that takes the best
of the past and adds new features related to the online environment and advances in the art of
programming. Perhaps most important, because of their similarities, C, C++, and Java define
a common, conceptual framework for the professional programmer. Programmers do not face
major rifts when switching from one language to another.
Java has another attribute in common with C and C++: it was designed, tested, and
refined by real working programmers. It is a language grounded in the needs and experiences
of the people who devised it. There is no better way to produce a top-flight professional
programming language.
One last point: although C++ and Java are related, especially in their support for object-
oriented programming, Java is not simply the “Internet version of C++.” Java has significant
practical and philosophical differences from C++. Furthermore, Java is not an enhanced version
of C++. For example, it is neither upwardly nor downwardly compatible with C++. Moreover,
Java was not designed to replace C++. Java was designed to solve a certain set of problems. C++
was designed to solve a different set of problems. They will coexist for many years to come.

How Java Impacted the Internet


The Internet helped catapult Java to the forefront of programming, and Java, in turn, had a
profound effect on the Internet. First, the creation of Java simplified Internet programming
in general, acting as a catalyst that drew legions of programmers to the Web. Second, Java
innovated a new type of networked program called the applet that changed the way the online
world thought about content. Finally, and perhaps most importantly, Java addressed some of
the thorniest issues associated with the Internet: portability and security.

01-ch01.indd 4 12/11/21 9:21 PM


BeginNew-Tight5.5 / Java: A Beginner’s Guide, Ninth Edition / Herbert Schildt / 355-9 / Chapter 1

Chapter 1: Java Fundamentals 5

Java Simplified Web-Based Programming


From the start, Java simplified web-based programming in a number of ways. Arguably the
most important is found in its ability to create portable, cross-platform programs. Of nearly
equal importance is Java’s support for networking. Its library of ready-to-use functionality
enabled programmers to easily write programs that accessed or made use of the Internet. It also
provided mechanisms that enabled programs to be readily delivered over the Internet. Although
the details are beyond the scope of this book, it is sufficient to know that Java’s support for
networking was a key factor in its rapid rise.

Java Applets
At the time of Java’s creation, one of its most exciting features was the applet. An applet
is a special kind of Java program that is designed to be transmitted over the Internet and
automatically executed inside a Java-compatible web browser. If the user clicks a link that
contains an applet, the applet will download and run in the browser automatically. Applets
were intended to be small programs, typically used to display data provided by the server,
handle user input, or provide simple functions, such as a loan calculator. The key feature of
applets is that they execute locally, rather than on the server. In essence, the applet allowed
some functionality to be moved from the server to the client.
The creation of the applet was important because, at the time, it expanded the universe
of objects that could move about freely in cyberspace. In general, there are two very broad
categories of objects that are transmitted between the server and the client: passive information
and dynamic active programs. For example, when you read your e-mail, you are viewing
passive data. Even when you download a program, the program’s code is still only passive
data until you execute it. By contrast, the applet is a dynamic, self-executing program. Such a
program is an active agent on the client computer, yet it is delivered by the server.
In the early days of Java, applets were a crucial part of Java programming. They illustrated
the power and benefits of Java, added an exciting dimension to web pages, and enabled
programmers to explore the full extent of what was possible with Java. Although it is likely
that there are still applets in use today, over time they became less important, and for reasons
that will be explained shortly, JDK 9 began their phase-out process. Finally, applet support was
removed by JDK 11.

Ask the Expert


Q: What is C# and how does it relate to Java?
A: A few years after the creation of Java, Microsoft developed the C# language. This is
important because C# is closely related to Java. In fact, many of C#’s features directly
parallel Java. Both Java and C# share the same general C++-style syntax, support
distributed programming, and utilize a similar object model. There are, of course,
differences between Java and C#, but the overall “look and feel” of these languages is very
similar. This means that if you already know C#, then learning Java will be especially easy.
Conversely, if C# is in your future, then your knowledge of Java will come in handy.

01-ch01.indd 5 12/11/21 9:21 PM


Discovering Diverse Content Through
Random Scribd Documents
time, or, brief as the span of man on earth has been, a wrong estimate of time
antecedent to the Christian period must have made it shorter.[191]
Darkness of complexion has been attributed to the sun’s power from the age of
Solomon to this day—“Look not upon me, because I am black, because the sun hath
looked upon me;” and there can be no doubt that, to a certain degree, the opinion is
well founded. The invisible rays in the solar beams, which change vegetable colours,
and have been employed with such remarkable effect in the Daguerreotype, act upon
every substance on which they fall, producing mysterious and wonderful changes in
their molecular state—man not excepted.[192]
Other causes must have been combined to occasion all the varieties we now see,
otherwise every nation between the tropics would be of the same hue, whereas the
sooty Negro inhabits equatorial Africa, the Red man equinoctial America, and both are
mixed with fairer tribes. In Asia, the Rohillas, a fair race of Affghan extraction, inhabit
the plains north of the Ganges: the Bengalee and the mountaineers of Nepaul are
dark, and the Mahrattas are yellow. The complexion of man varies with height and
latitude; some of the inhabitants of the Himalaya and Hindoo Koosh are fair, and even
a red-haired race is found on the latter. There are fair-haired people with blue eyes in
the Ruddhua mountains in Africa. The Kabyles, that inhabit the country behind Tunis
and Algiers, are similar in complexion to the nations in high northern latitudes. This
correspondence, however, only maintains with regard to the northern hemisphere, for
it is a well-known fact that the varieties of the numerous species in the great southern
continents are much more similar in physical characters to the native races of the torrid
zone, than any of the aboriginal people of the northern regions. Even supposing that
diversity of colour is owing to the sun’s rays only, it is scarcely possible to attribute the
thick lips, the woolly hair, and the entire difference of form, extending even to the very
bones and skull, to anything but a concurrence of circumstances, not omitting the
invisible influence of electricity, which pervades every part of the earth and air—and
possibly terrestrial magnetism.
The flexibility of man’s constitution enables him to live in every climate, from the
equator to the ever-frozen coasts of Nova Zembla and Spitzbergen, and that chiefly by
his capability of bearing the most extreme changes of temperature and diet, which are
probably the principal causes of the variety in his form. It has already been mentioned
that oxygen is inhaled with the atmospheric air, and also taken in by the pores on the
skin; part of it combines chemically with the carbon of the food, and is expired in the
form of carbonic acid gas and water; that chemical action is the cause of vital force
and heat in man and animals. The quantity of food must be in exact proportion to the
quantity of oxygen inhaled, otherwise disease and loss of strength would be the
consequence. Since cold air is incessantly carrying off warmth from the skin, more
exercise is requisite in winter than in summer, in cold climates than in warm;
consequently, more carbon is necessary in the former than in the latter, in order to
maintain the chemical action that generates heat, and to ward off the destructive
effects of the oxygen, which incessantly strives to consume the body. Animal food,
wine, and spirits, contain many times more carbon than fruit and vegetables, therefore
animal food is much more necessary in a cold than in a hot climate. The esquimaux,
who lives by the chace, and eats 10 or 12 pounds weight of meat and fat in 24 hours,
finds it not more than enough to keep up his strength and animal heat, while the
indolent inhabitant of Bengal is sufficiently supplied with both by his rice diet. Clothing
and warmth make the necessity for exercise and food much less, by diminishing the
waste of animal heat. Hunger and cold united soon consume the body, because it loses
its power of resisting the action of the oxygen, which consumes part of our substance,
when food is wanting. Hence, nations inhabiting warm climates have no great merit in
being abstemious, nor are those guilty of committing an excess who live more freely in
colder countries. The arrangement of Divine Wisdom is to be admired in this as in all
other things, for, if man had only been capable of living on vegetable food, he never
could have had a permanent residence beyond the latitude where corn ripens. The
Esquimaux, and all the inhabitants of the very high latitudes of both continents, live
entirely on fish and animal food. What effects the difference of food may have upon
the intellect is not known.
A nation or tribe driven by war, or any other cause, from a warm to a cold country,
or the contrary, would be forced to change their food both in quality and quantity,
which in the lapse of ages might produce an alteration in the external form and
internal structure. The probability is still greater, if the entire change that a few years
produces in the matter of which the human frame is composed be considered. At every
instant during life, with every motion, voluntary and involuntary, with every thought
and every exercise of the brain, a portion of our substance becomes dead, separates
from the living part, combines with some of the inhaled oxygen, and is removed. By
this process it is supposed that the whole body is renewed every 7 years; individuality,
therefore, depends on the spirit, which retains its identity during all the changes of its
earthly house, and sometimes even acts independently of it. When sleep is restoring
exhausted nature, the spirit is often awake and active, crowding the events of years
into a few seconds, and, by its unconsciousness of time, anticipates eternity. Every
change of food, climate, and mental excitement, must have their influence on the
reproduction of the mortal frame; and thus a thousand causes may co-operate to alter
whole races of mankind placed under new circumstances, time being granted.
The difference between the effects of manual labour and the efforts of the brain
appears in the intellectual countenance of the educated man, compared with that of
the peasant, though even he is occasionally stamped with nature’s own nobility. The
most savage people are also the ugliest. Their countenance is deformed by violent
unsubdued passions, anxiety, and suffering. Deep sensibility gives a beautiful and
varied expression, but every strong emotion is unfavourable to perfect regularity of
feature; and of that the Greeks were well aware when they gave that calmness of
expression and repose to their unrivalled statues. The refining effects of high culture,
and, above all, the Christian religion, by subduing the evil passions, and encouraging
the good, are more than anything calculated to improve even the external appearance.
The countenance, though perhaps of less regular form, becomes expressive of the
amiable and benevolent feelings of the heart, the most captivating and lasting of all
beauty.[193]
Thus, an infinite assemblage of causes may be assigned as having produced the
endless varieties in the human race; but the fact remains an inscrutable mystery. But
amidst all the physical vicissitudes man has undergone, the species remains
permanent; and let those who think that the difference in the species of animals and
vegetables arises from diversity of conditions, consider, that no circumstances
whatever can degrade the form of man to that of the monkey—or elevate the monkey
to the form of man.
Animals and vegetables, being the sources of man’s sustenance, have had the chief
influence on his destiny and location, and have induced him to settle in those parts of
the world where he could procure them in greatest abundance. Wherever the chace or
the spontaneous productions of the earth supply him with food, he is completely
savage, and only a degree further advanced where he plants the palm and the banana;
where grain is the principal food, industry and intelligence are most perfectly
developed, as in the temperate zone. On that account the centres of civilization have
generally been determined, not by a hot, but by a genial climate, fertile soil, by the
vicinity of the sea-coast or great rivers, affording the means of fishing and transport,
which last has been one of the chief causes of the superiority of Europe and Southern
Asia. The mineral treasures of the earth have been the means of assembling great
masses of men in Siberia and the table-land of the Andes, and have given rise to many
great cities, both in the Old and the New World. Nations inhabiting elevated table-lands
and high ungenial latitudes have been driven there by war, or obliged to wander from
countries where the population exceeded the means of living—a cause of migration to
which both language and tradition bear testimony. The belief in a future state, so
universal, shown by respect for the dead, has no doubt been transmitted from nation
to nation. The American Indians, driven from their hunting-grounds, still make
pilgrimages to the tombs of their fathers; and these tribes alone, of all uncivilized
mankind, worship the Great Spirit as the invisible God and Father of all—a degree of
abstract refinement which could hardly have sprung up spontaneously among a rude
people, and which must have been transmitted from races who held the Jewish faith.
It is probable that America had been peopled from Asia before the separation of the
continents by Behring’s Straits, and there is reason to believe that the location of
various races of mankind, now insulated, may have taken place before the separation
of the lands by mediterranean seas; whilst others, previously insulated, may be now
united by the drying up of inland seas, as those which covered the Sahara desert, and
the great hollow round the Caspian Sea, of which it and the Black Sea are probably the
remnants.
M. Boué has observed that mountain chains running nearly east and west establish
much more striking differences among nations than those which extend from north to
south—a circumstance confirmed by observation through the history of mankind. The
Scandinavian Alps have not prevented the countries on both sides from being occupied
by people of a common descent; while the feeble barrier of the Cheviot Hills, between
England and Scotland, and the moderate elevation of the Highland mountains, have
prevented the amalgamation of the Anglo-Saxons and the Celts, even in a period of
high civilization. The Franks and Belgians are distinct, though separated by hills of still
less elevation. For the same reason the Spaniards and Italians differ far more from
their neighbours on the other side of the eastern and western chains, than the
Spaniards do from the Portuguese, or the Piedmontese from the Provençals. A similar
distinction prevails throughout Asia; and in America, where all the principal chains run
north and south, there is but one copper-coloured race throughout the continent,
which stretches over more climates than Europe and Africa, or even than Asia and
Australia, united. It is along chains running north and south that the fusion of
languages takes place, and not along those of an easterly and westerly direction. From
Poland, for instance, there are intermediate insensible gradations through Germany
into France; while in crossing from a German district of the Alps to the valleys of Italy,
different tribes and different languages are separated by a single mountain. Even wars
and conquest have ever been more easy in one direction than in the other. The
difference in the fauna and flora on the two sides of the great table-land and
mountains of Asia is a striking illustration of the influence which high lands running
east and west have on natural productions, and thus, both directly and indirectly, they
affect the distribution of mankind.
The circumstances which thus determine the location of nations, and the fusion or
separation of their languages, must, conjointly with moral causes, operate powerfully
on their character. The minds of mankind, as well as their fate, are influenced by the
soil on which they are born and bred. The natives of elevated countries are attached to
their mountains; the Dutch are as much attached to their meadows and canals; and
the savage, acquainted only with the discomforts of life, is unhappy when brought
among civilized man. Early associations never entirely leave us, however much our
position in life may alter, and strong attachments are formed to places which generate
in us habits differing from those of other countries.
The Baltic and Mediterranean Seas have had no inconsiderable share in civilizing
Europe; one combined with a cold and gloomy climate, the other with a warm and
glowing sky, have developed dissimilar characters in the temperament and habits of
the surrounding nations, originally dissimilar in race. The charms of climate, and the
ease with which the necessaries of life are procured, were favourable to the
development of imagination in the more southern nations, and to an indolent
enjoyment of their advantages. In the north, on the contrary, the task imposed upon
man was harder, and perhaps more favourable to strength of character. The Dutch owe
their industry and perseverance to their unceasing struggle against the encroachments
of the ocean; the British are indebted to their insular position for their maritime
disposition, and to the smallness of their country and the richness of their mines, for
their manufacturing and colonizing habits; the military propensities of the French, to
the necessity of maintaining their independence among the surrounding nations, as
well as to ambition and the love of fame.
Thus, external circumstances materially modify the character of nations, but the
original propensities of race are never eradicated, and they are nowhere more
prominent than in the progress of the social state in France and England. The vivacity
and speculative disposition of the Celt appear in the rapid and violent changes of
government and in the succession of theoretical experiments in France; while in Britain
the deliberate slowness, prudence, and accurate perceptions of the Teuton are
manifest in the gradual improvement and steadiness of their political arrangements.
“The prevalent political sentiment of Great Britain is undoubtedly conservative, in the
best sense of the word, with a powerful under-current of democratic tendencies. This
gives great power and strength to the political and social body of this country, and
makes revolutions by physical force almost impossible. It can be said, without
assumption or pretension, that the body politic of Britain is in a sounder state of health
than any other in Europe; and that those know very little of this country, who, led
away by what they see in France, always dream of violent and revolutionary changes in
the constitution. Great Britain is the only country in Europe which has had the good
fortune to have all her institutions worked out and framed by her in a strictly organic
manner—that is, in accordance with organic wants, which require different conditions
at different and successive stages of national development—and not by theoretical
experiments, as in many other countries which are still in a state of excitement
consequent upon these experiments. The social character of the people of this country,
besides the features which they have in common with other nations of Teutonic origin,
is, on the whole, domestic, reserved, aristocratic, and exclusive.”[194]
In speculating upon the effects of external circumstances, and on the original
dispositions of the different races of mankind, the stationary and unchanged condition
is a curious phenomenon in the history of nations. The inhabitants of Hindostan have
not advanced within the historical period; neither have the Chinese. The Peruvians and
Mexicans had arrived at a considerable degree of civilization, at which they became
stationary, never having availed themselves of their fine country and noble rivers; and
their conquerors, the Spaniards, degenerated into the same apathy with the
conquered. The unaccountable gipsies have for ages maintained their peculiarities in all
countries; so have the Jews and Armenians, who by the perseverance with which they
have adhered to their language and institutions, have resisted the influence of physical
impressions.
The influence of external circumstances on man is not greater than his influence on
the material world. He cannot create power, it is true, but he dexterously avails himself
of the powers of nature to subdue nature. Air, fire, water, steam, gravitation, his own
muscular strength, and that of animals rendered obedient to his will, are the
instruments by which he has converted the desert into a garden, drained marshes, cut
canals, made roads, turns the course of rivers, cleared away forests in one country,
and planted them in another. By these operations he has altered the climate, changed
the course of local winds, increased or diminished the quantity of rain, and softened
the rigour of the seasons. In the time of Strabo, the cold in France was so intense, that
it was thought impossible to ripen grapes north of the Cevennes: the Rhine and the
Danube were every winter covered with ice thick enough to bear any weight. Man’s
influence on vegetation has been immense, but the most important changes had been
effected in the antediluvian ages of the world. Cain was a tiller of the ground. The
olive, the vine, and the fig-tree have been cultivated time immemorial: wheat, rice, and
barley, have been so long in an artificial state, that their origin is unknown; even
maize, which is a Mexican plant, was in use among the American tribes before the
Spanish conquest; and tobacco was already used by them to allay the pangs of hunger,
to which those who depend upon the chace for food must be exposed. Most of the
ordinary culinary vegetables have been known for ages, and it is remarkable that in
these days, when our gardens are adorned with innumerable native plants in a
cultivated state, few new grains, vegetables, or fruits have been reclaimed; the old
have been produced in infinite variety, and many brought from foreign countries: yet
there must exist many plants capable of cultivation, as unpromising in their wild state
as the turnip or carrot.
Some families of plants are more susceptible of improvement than others, and, like
man himself, can bear almost any climate. One kind of wheat grows to 62° N. latitude;
rye and barley are hardier, and succeed still farther north; and few countries are
absolutely without grass. The cruciform tribe abounds in useful plants, indeed that
family, together with the solanum, the papilionaceous and umbelliferous tribes, furnish
most of our vegetables. Many plants, like animals, are of one colour only in their wild
state, and their blossoms are single. Art has introduced the variety we now see in the
same species, and, by changing the anthers of the wild flowers into petals, has
produced double blossoms: by art, too, many plants, natives of warm countries, have
been naturalized in colder climates. Few useful plants have beautiful blossoms—but if
utility were the only object, of what pleasure should we be deprived! Refinement is not
wanting in the inmates of a cottage covered with roses and honeysuckle; and the little
garden cultivated amidst a life of toil, tells of a peaceful home.
Among the objects which tend to the improvement of our race, the flower-garden
and the park adorned with native and foreign trees have no small share: they are the
greatest ornaments of the British Islands; and the love of a country life, which is so
strong a passion, is chiefly owing to the law of primogeniture, by which the head of a
family is secured in the possession and transmission of his undivided estate, and
therefore each generation takes pride and pleasure in adorning the home of its
forefathers.
Animals yield more readily to man’s influence than vegetables, and certain classes
have greater flexibility of disposition and structure than others. Those only are capable
of being perfectly reclaimed that have a natural tendency for it, without which man’s
endeavours would be unavailing. This predisposition is greatest in animals which are
gregarious and follow a leader, as elephants, dogs, horses, and cattle do in their wild
state; yet even among these some species are refractory, as the buffalo, which can
only be regarded as half-reclaimed. The canine tribe, on the contrary, are capable of
the greatest attachment, not the dog only, man’s faithful companion, but even the
wolf, and especially the hyæna, generally believed to be so ferocious. After an absence
of many months, a hyæna which had been the fellow-passenger of a friend of the
author’s in a voyage from India, recognized his voice before he came in sight, and on
seeing him it showed the greatest joy, lay down like a dog and licked his hands. He
had been kind to it on the voyage, and no animal forgets kindness, which is the surest
way of reclaiming them. There cannot be a greater mistake than the harsh and cruel
means by which dogs and horses are too commonly trained; but it is long before man
learns that his power is mental, and that it is his intellect alone that has given him
dominion over the earth and its inhabitants, of which so many far surpass him in
physical strength. The useful animals were reclaimed by the early inhabitants of Asia,
and it is very remarkable, notwithstanding the enterprise and activity of the present
times, that among the multitudes of animals that inhabit America, Central and
Southern Africa, Australia and the Indian Archipelago, 4 only have been domesticated,
yet many may be capable of becoming useful to man. Of 35 species, of which we
possess one or more domestic races, 31 are natives of Asia, Europe, and North Africa;
these countries are far from being exhausted, and a complete hemisphere is yet
unexplored. An attempt has been made to domesticate the Llama, the Dziggetai,
Zebra, and some species of Indian deer, but the success is either doubtful or the
attempt has not been followed up. Little has been left for modern nations but the
improvement of the species, and in that they have been very successful. The variety of
horses, dogs, cattle, and sheep is beyond number. The form, colour, and even the
disposition, may be materially altered, and the habits engrafted are transmitted to the
offspring, as instinctive properties independent of education. Domestic fowls go in
flocks on their native meads when wild. There are, however, instances of solitary birds
being tamed to an extraordinary degree, as the raven, one of the most sagacious.
Man’s necessities and pleasure have been the cause of great changes in the animal
creation—and his destructive propensity of still greater. Animals are intended for our
use, and field-sports are advantageous by encouraging a daring and active spirit in
young men, but the utter destruction of some races, in order to protect those destined
for his pleasure, is too selfish. Animals soon acquire a dread of man, which becomes
instinctive and hereditary; in newly-discovered uninhabited countries, birds and beasts
are so tame as to allow themselves to be caught; whales scarcely got out of the way of
the ships that first navigated the Arctic Ocean, but now they universally have a dread
of the common enemy: whales and seals have been extirpated in various places; sea-
fowl and birds of passage are not likely to be extinguished, but many land animals and
birds are vanishing before the advance of civilization. Drainage, cultivation, cutting
down of forests, and even the introduction of new plants and animals, destroy some of
the old, and alter the relations between those that remain. The inaccessible cliffs of the
Himalaya and Andes will afford a refuge to the eagle and condor, but the time will
come when the mighty forests of the Amazons and Orinoco will disappear with the
myriads of their joyous inhabitants. The lion, the tiger, and the elephant will be known
only by ancient records. Man, the lord of the creation, will extirpate the noble creatures
of the earth—but he himself will ever be the slave of the canker-worm and the fly.
Cultivation may lessen the scourge of the insect tribe, but God’s great army will ever,
from time to time, appear suddenly—no one knows from whence; the grub will take
possession of the ground, and the locust will come from the desert and destroy the
fairest prospects of the harvest.
Though the unreclaimed portion of the animal creation is falling before the progress
of improvement, yet man has been both the voluntary and the involuntary cause of the
introduction of new animals and plants into countries in which they were not natives.
The Spanish conquerors little thought that the descendants of the few cattle and
horses they allowed to run wild, would resume the original character of their species,
and roam in hundreds of thousands over the savannahs of South America. Wherever
man is, civilized or savage, there also is the dog, but he too has in some places
resumed his native state and habits, and hunts in packs. Domestic animals, grain, fruit,
vegetables, and the weeds that grow with them, have been conveyed by colonists to
all settlements. Birds and insects follow certain plants into countries in which they were
never seen before. Even the inhabitants of the waters change their abode in
consequence of the influence of man. Fish, natives of the rivers on the coast of the
Mexican Gulf, have migrated by the canals to the heart of North America; and the
mytilus polymorphus, a shell-fish brought to the London Docks in the timbers of ships
from the brackish waters of the Black Sea and its tributary streams, has spread into
the interior of England by the Croydon and other canals.
The influence of man on man is a power of the highest order, far surpassing that
which he possesses over inanimate or animal nature. It is, however, as a collective
body, and not as an individual, that he exercises this influence over his fellow-
creatures. The free-will of man, nay, even his most capricious passions, neutralize each
other, when large numbers of men are considered. Professor Quetelet has most ably
proved, that the greater the number of individuals, the more completely does the will
of each, as well as all individual peculiarities, moral or physical, disappear, and allow
the series of general facts to predominate, which depend upon the causes by which
society exists and is preserved. The uniformity with which the number of marriages in
Belgium occurred in 20 years, places the neutralization of the free-will of the individual
man beyond a doubt, and is one of many instances of the importance of average
quantities in arriving at general laws.
Certainly no event in a man’s life depends more upon his free will than his marriage,
yet it appears from the records in Brussels, that nearly the same number of marriages
take place every year, in the towns as well as in the country, and, moreover, that the
same constancy prevails in each province, though the numbers of the people are so
small, that accidental causes might be more likely to affect the general result than
when the numbers are larger. In fact the whole affair passes as if the inhabitants of
Belgium had agreed to contract nearly the same number of marriages annually, at each
stage of life. Young people may possibly be in some degree under the control of
parents, but there can be no restraint on the free will of men of 30 and women of 60
years of age, yet the same number of such incongruous marriages do annually take
place between men and women at those unsuitable ages—a fact which almost exceeds
belief. The day fixed for a wedding is of all things most entirely dependent on the will
of the parties, yet even here there is regularity in the annual recurrence. (See Table on
next page.)
With regard to crimes also, M. Quetelet observes that the same number of crimes of
the same description are committed annually, with remarkable uniformity, even in the
case of those crimes which would seem most likely to baffle all attempt at prediction.
The same regularity occurs in the sentences passed on criminals: in France, in every
hundred trials there were sixty-one convictions regularly, year after year.
Forgetfulness, as well as free-will, is under constant laws: the number of undirected
letters put into the post-office in London and in Paris is very nearly the same year after
year respectively—in London they amount to 2000: so that even the deviations from
free-will proves the generality and the constancy of the laws that govern us.
Scientific discoveries and social combinations, which put in practice great social
principles, are not without a decided influence; but these causes of action coming from
man, are placed out of the sphere of the free-will of each: so that individual impulse
has less to do with the progress of mankind than is generally believed. When society
has arrived at a certain point of advancement, certain discoveries will naturally be
made; the general mind is directed that way, and if one individual does not hit upon
the discovery, another will. Therefore, on the disputes and discussions of different
nations for the honour of particular inventions or discoveries, as for example the
steam-engine, a narrow view of the subject is taken; they properly belong to the age
in which they are made, without derogating from the merits of those benefactors of
mankind who have lessened his toil or increased his comfort by the efforts of their
genius. The time had come for the invention of printing, and printing was invented;
and the same observation is applicable to many objects in the physical, as well as to
the moral world. In the present disturbed state of society the time is come for the
termination of the feudal system, which will be swept away by the force of public
opinion, though individuality merges in these general movements.
The following Table, which is one of the most curious of statistical documents, was
formed by Professor Quetelet from
the Register of Marriages at Brussels:—
MARRIAGES IN BELGIUM IN THE YEARS
1841 1842 1843 1844 1845

Women
of 30
years of 12,788 12,422 12,368 13,024 13,157
age and
under
Men of 30 Women
years of from 30 2,630 2,626 2,406 2,375 2,438
age and to 45
under, to
Women
from 45 93 121 125 129 102
to 60
Women
from 60 7 6 8 5 8
upwards

Men from 30 Women


to 35 of 30
6,122 5,803 5,617 4,948 5,810
inclusive, and
to under
Women
from 30 5,531 5,396 5,100 5,205 4,981
to 45
Women
from 45 529 542 479 493 532
to 60
Women
from 60 18 12 18 21 21
upwards

Women
of 30
376 346 380 355 346
and
under
Men from 45 Women
to 60 from 30 896 879 896 951 993
inclusive, to 45
to Women
from 45 461 447 433 462 460
to 60
Women
from 60 23 19 29 36 28
upwards

Women
of 30
48 35 45 41 36
and
under
Men from 60 Women
and from 30 139 147 133 119 125
above, to 45
to Women
from 45 153 170 137 112 145
to 60
Women
from 60 62 52 48 50 31
upwards
Annual Number of
29,876 29,023 28,220 29,326 29,210
Marriages
Though each individual is accountable to God for his conduct, it is evident that the
great laws which regulate mankind are altogether independent of his will, and that
liberty of action is perfectly compatible with the general design of Providence. “A more
profound study of the social system will have the effect of limiting more and more the
sphere in which man’s free-will is exercised, for the Supreme Being could not grant him
a power which tends to overthrow the laws impressed on all the parts of creation: He
has traced its limits, as He has fixed those of the ocean.”
Man is eminently sociable; he willingly gives up part of his free-will to become a
member of a social body; and it is this portion of the individuality of each member of
that body, taken in the aggregate, which becomes the directrice of the principal social
movements of a nation. It may be greater or less, good or bad, but it determines the
customs, wants, and the national spirit of a people; it regulates the sum of their moral
statistics; and it is in that manner that the cultivation or savageness, the virtues or the
vices, of individuals have their influence. It is thus that private morality becomes the
base of public morality.
The more man advances in civilization the greater will be his collective influence, for
knowledge is power; and at no time did the mental superiority of the cultivated races
produce such changes as they do at present, because they have extended their
influence to the uttermost parts of the earth by emigration, colonization, and
commerce. In civilized society the number of people in the course of time exceeds the
means of sustenance, which compels some to emigrate; others are induced by a spirit
of enterprise to go to new countries, some for the love of gain, others to fly from
oppression.
The discovery of the New World opened a wide field for emigration. Spain and
Portugal, the first to avail themselves of it, acquired dominion over some of the finest
parts of South America, which they have maintained till lately a change of times has
rendered their colonies independent states. Liberal opinions have spread into the
interior of that continent, in proportion to the facility of communication with the cities
on the coasts, from whence European ideas are disseminated. Of this Venezuela and
Chile are instances, where civilization and prosperity have advanced more rapidly than
in the interior parts of South America, where the Andes are higher and the distance
from the sea greater. Civilization has been impeded in many of the smaller states by
war, and those broils inevitable among people unaccustomed to free institutions. Brazil
would have been further advanced but for slavery, that stain on the human race, which
corrupts the master as much as it debases the slave.
Some of the native South American tribes have spontaneously made considerably
progress in civilization in modern times; others have benefited by the Spanish and
Portuguese colonists; and many have been brought into subjection by the Jesuits, who
have instructed them in some of the arts of social life. But these Indians are not more
religious than their neighbours, and, from the restraint to which they have been
subject, have lost vigour of character without improving in intellect; so that now they
are either stationary or retrograde. Extensive regions are still the abode of men in the
lowest state of barbarism: some of the tribes inhabiting the silvas of the Orinoco,
Amazons, and Uruguay are cannibals.
The arrival of the colonists in North America sealed the fate of the red men. The
inhabitants of the Union, too late awakened to the just claims of the ancient
proprietors of the land, have recently, but vainly, attempted to save the remnant. The
white man, like an irresistible torrent, has already reached the centre of the continent;
and the native tribes now retreat towards the far west, and will continue to retreat, till
the Pacific Ocean arrests them, and the animals on their hunting-grounds are
exterminated. The almost universal dislike the Indian has shown for the arts of peace
has been one of the principal causes of his decline, although the Cherokee tribe, which
has lately migrated to the west of the Mississippi, is a remarkable exception; the
greater number of them are industrious planters or mechanics; they have a republican
government, and publish a newspaper in their own language, in a character lately
invented by one of that nation.
No part of the world has been the scene of greater iniquity than the West Indian
islands—and that perpetrated by the most enlightened nations of Europe. The native
race has long been swept away by the stranger, and a new people, cruelly torn from
their homes, have been made the slaves of hard task-masters. If the odious
participation in this guilt has been a stain on the British name, the abolition of slavery
by the universal acclamation of the nation will ever form one of the brightest pages in
their history, so full of glory: nor will it be the less so, that justice was combined with
mercy, by the millions of money granted to indemnify the proprietors. It is deeply to be
lamented that our brethren on the other side of the Atlantic have not followed the
example of their fatherland; but in limited monarchies the voice of the people is
listened to, while republican governments are more apt to become its slave. The
Northern States have nobly declared every man free who sets his foot on their territory
—and the time will come when the Southern States will sacrifice interest to justice and
mercy.
It seems to be the design of Providence to supplant the savage by civilized man in
the continent of Australia as well as in North America, though every effort has been
made to prevent the extinction of the natives. Most of the tribes in that continent are
as low in the scale of mankind as the cannibal Fuegians, whom Captain Fitzroy so
generously, but so ineffectually, attempted to reclaim. Some of the New Hollanders are
faithful servants for a time, but they almost always find the restraint of civilized life
irksome, and return to their former habits, though truly miserable in a country where
the means of existence are so scanty. Animals and birds are very scarce, and there is
no fruit or vegetable for the sustenance of man.
Slavery has been a greater impediment to the improvement of Africa than even the
physical disadvantages of the country—the great arid deserts and unwholesome
coasts. A spontaneous civilization has arisen in various parts of Southern and Central
Africa, in which there has been considerable progress in agriculture and commerce; but
civilized man has been a scourge on the Atlantic coast, which has extended its baneful
influence into the heart of the continent, by the encouragement it has given to warfare
among the natives for the capture of slaves, and for the introduction of European
vices, unredeemed by Christian virtues. Now that France and England have united in
the suppression of this odious traffic, some hopes may be entertained that their
colonies may be beneficial to the natives, and that other nations may follow their
example, in which, however, they have been anticipated by three Mahommedan
sovereigns; the Sultan has abolished the slave market in Constantinople, Ibrahim
Pasha on his return from France and England gave freedom to his bondsmen in Egypt,
and the Bey of Tunis has abolished slavery in his dominions.
The French are zealous in improving the people in Algiers, but the constant warfare
in which they have been embroiled ever since their conquest must render their success
in civilizing the natives at least remote. The inhabitants of those extensive and
magnificent countries in the eastern seas that have long been colonized by the Dutch
have made but little progress under their rule.
The British colony at the Cape of Good Hope has had considerable influence on the
neighbouring rude nations, who now begin to adopt more civilized habits. When Mr.
Somerville visited Litako, the natives for the first time saw a white person and a horse,
and were scantily clothed with skins. When Dr. Smith visited them 20 years afterwards,
he found the chief men mounted on horseback, wearing hats made of rushes, and an
attempt made to imitate European dress.
Colonization has nowhere produced such happy results as among the amiable and
cultivated inhabitants of India, who are sensible of the benefits they derive from the
impartial administration of just and equal laws, the foundation of schools and colleges,
and the wide extension of commerce.
All the causes of emigration have operated by turns on the inhabitants of Britain,
and various circumstances have concurred to make their colonies permanent. In North
America, that which not many years ago was a British colony has become a great
independent nation, occupying a large portion of the continent. The Australian
continent and New Zealand will in after ages be peopled by a British race, and will
become centres of civilization which will spread its influence to the uttermost islands of
the Pacific. These splendid islands, possessing every advantage of climate and soil,
with a population in many parts far advanced in the arts of civilized life, industry, and
commerce, though in others savage, will in time come in for a share of the general
improvement. The success that has attended the noble and unaided efforts of Sir J.
Brooke in Borneo, shows how much the influence of an active and benevolent mind
can in a short time effect.
The colonies on the continent of India are already centres from which the culture of
Europe is spreading over the East.
Commerce has not less influence on mankind than colonization, with which it is
intimately connected; and the narrow limits of the British Islands have rendered it
necessary for its inhabitants to exert their industry. The riches of our mines in coal and
metals, which produce a yearly income of 24,000,000l. sterling, is a principal cause of
our manufacturing and commercial wealth; but even with these natural advantages,
more is due not only to our talents and enterprise, but to our high character for faith
and honour.
Every country has its own peculiar productions, and by an unrestrained interchange
of the gifts of Providence the condition of all is improved. The exclusive jealousy with
which commerce has hitherto been fettered, shows the length of time that is necessary
to wear out the effects of those selfish passions which separated nations when they
were yet barbarous. It required a high degree of cultivation to break down those
barriers consecrated by their antiquity; and the accomplishment of this important
change evinces the rate at which the present age is advancing.
A new era in the history of the world began when China was opened to European
intercourse; but many years must pass before European influence can penetrate that
vast empire, and eradicate those illiberal prejudices by which it has so long been
governed.
Two important triumphs yet remain to be achieved over physical difficulties by the
science and energy of man, namely, the junction of the Pacific and Atlantic Oceans at
the Isthmus of Central America, and the union of the Red Sea with the Mediterranean
at that of Suez. The first seems to be on the eve of accomplishment, and, in
conjunction with the treasures with which the auriferous district of California is said to
abound, may bring about a complete revolution in the tide of affairs; and that country,
hitherto so completely separated from the rest of the world and so little known, will
become a new centre of civilization, whose influence will be diffused over the wide
Pacific to the shores of the eastern continent; the expectation of Columbus will then be
realized—of a passage to the East Indies by the Atlantic. Should the Mediterranean and
Red Sea be united by a water communication, Alexandria, Venice, and the other
maritime cities of southern Europe may regain, at least in part, the mercantile position
which they lost by the discovery of Vasco da Gama.[195]
The advantages of colonization and commerce to the less civilized part of the world
are incalculable, as well as to those at home, not only by furnishing an exchange for
manufactures, important as this is, but by the immense accession of knowledge of the
earth and its inhabitants, that has been thus attained.
The history of former ages exhibits nothing to be compared with the mental activity
of the present. Steam, which annihilates time and space, fills mankind with schemes
for advantage or defence: but however mercenary the motives for enterprise may be,
it is instrumental in bringing nations together. The facility of communication is rapidly
assimilating national character. Society in most of the capitals is formed on the same
model; and as the study of modern languages is now considered a part of polite
education, and every well-educated person speaks more than one modern tongue, one
of the great barriers to the assimilation of character amongst nations will be removed.
Science has never been so extensively and so successfully cultivated as at the
present time: the collective wisdom and experience of Europe and the United States of
America is now brought to bear on subjects of the highest importance in annual
meetings, where the common pursuit of truth is as beneficial to the moral as to the
intellectual character, and the noble objects of investigation are no longer confined to a
philosophic few, but are becoming widely diffused among all ranks of society, and the
most enlightened governments have given their support to measures that could not
have been otherwise accomplished.[196] Simultaneous observations are made at
numerous places in both hemispheres on electricity, magnetism, on the tides and
currents of the air and the ocean, and those mysterious vicissitudes of temperature
and moisture, which bless the labours of the husbandman one year, and blight them in
another.
The places of the nebulæ and fixed stars, and their motions, are known with
unexampled precision, and the most refined analyses embrace the most varied objects.
Three new satellites and six new planets have been discovered within four years, and
one of these under circumstances the most unprecedented. In the far heavens, from
disturbances in the motions of Uranus which could not be accounted for, an unknown
and unseen body was declared to be revolving on the utmost verge of the solar
system; and it was found in the very region of the heavens pointed out by analysis. On
earth, though hundreds of miles apart, that invisible messenger, electricity,
instantaneously conveys the thoughts of the invisible spirit of man to man—results of
science sublimely transcendental.
Vain would be the attempt to enumerate the improvements in machinery and
mechanics, the canals and railroads that have been made, the harbours that have been
improved, the land that has been drained, the bridges that have been constructed; and
now, although Britain is inferior to none in many things, and superior to all in some,
one of our most distinguished engineers declares that we are scarcely beyond the
threshold in improvement; to stand still is to retrograde, human ingenuity will always
keep pace with the unforeseen, the increasing wants of the age.[197] “Who knows what
may yet be in store for our use; what new discovery may again change the tide of
human affairs; what hidden treasures may yet be brought to light in the air or in the
ocean, of which we know so little; or what virtues there may be in the herbs of the
field, and in the treasures of the earth—how far its hidden fires, or stores of ice, may
yet become available—ages can never exhaust the treasures of nature or the talent of
man.”[198] It would be difficult to follow the rapid course of discovery through the
complicated mazes of magnetism and electricity; the action of the electric current on
the polarized sun-beam, one of the most beautiful of modern discoveries, leading to
relations hitherto unsuspected between that power and the complex assemblage of
visible and invisible influences on solar light, by one of which nature has recently been
made to paint her own likeness. It is impossible to convey an idea of the rapid
succession of the varied and curious results of chemistry, and its application to
physiology and agriculture; moreover, distinguished works have lately been published
at home and abroad on the science of mind, which has been so successfully cultivated
in our own country. Geography has assumed a new character, by that unwearied
search for accurate knowledge and truth that marks the present age, and physical
geography is altogether a new science.
The spirit of nautical and geographical discovery, begun in the 15th century, by those
illustrious navigators who had a new world to discover, is at this day as energetic as
ever, though the results are less brilliant. Neither the long gloomy night of a polar
winter, nor the dangers of the ice and the storm, deter our gallant seamen from
seeking a better acquaintance with “this ball of earth,” even under its most frowning
aspect; and that, for honour, which they are as eager to seek even in the cannon’s
mouth. Nor have other nations of Europe and America been without their share in
these bold adventures. The scorching sun and deadly swamps of the tropics as little
prevent the traveller from collecting the animals and plants of the present creation, or
the geologist from investigating those of ages long gone by. Man daily indicates his
birthright as lord of the creation, and compels every land and sea to contribute to his
knowledge.
The most distinguished modern travellers, following the noble example of Baron
Humboldt, the patriarch of physical geography, take a more extended view of the
subject than the earth and its animal and vegetable inhabitants afford, and include in
their researches the past and present condition of man, the origin, manners, and
languages of existing nations, and the monuments of those that have been. Geography
has had its dark ages, during which the situation of many great cities and spots of
celebrity in sacred and profane history had been entirely lost sight of, which are now
discovered by the learning and assiduity of the modern traveller. Of this, Italy, Egypt,
the Holy Land, Asia Minor, Arabia, and the valleys of the Euphrates and Tigris, with the
adjacent mountains of Persia, are remarkable instances, not to mention the vast region
of the East, and the remote centres of aboriginal civilization in the New World. The
interesting discoveries of Mr. Layard, who possessed every acquirement that could
render a traveller competent to accomplish so arduous an undertaking, have brought
to light the long-hidden treasures of the ancient Nineveh, where its own peculiar style
of art had existed anterior to that of Egypt.[199] In many parts of the world the ruins of
cities of extraordinary magnitude and architecture show that there are wide regions of
whose original inhabitants we know nothing. The Andes of Peru and Mexico have
remains of civilized nations before the age of the Incas. Mr. Pentland has found
numerous remains of Peruvian monuments in every part of the great valley of the
Peru-Bolivian Andes, and many parts of the imperial capital Cusco, little changed from
what they were at the downfall of Atahualpa. Mr. Stephens has found in the woods of
Central America the ruins of great cities, adorned with sculpture and pictorial writings,
vestiges of a people far advanced, who had once cultivated the soil where these
entangled forests now grow. Picture-writings have been discovered by Sir Robert
Schomburgk on rocks in Guiana, spread over an extent of 350,000 square miles,
similar to those found in the United States and in Siberia. Magnificent buildings still
exist in good preservation all over eastern Asia, and many in a ruinous state belong to
a period far beyond written record.
Ancient literature has furnished a subject of still more interesting research, from
which it is evident that the mind of man is essentially the same under very different
circumstances: every nation far advanced in civilization has had its age of poetry, the
drama, romance, and philosophy, each stamped with the character of the people and
times, and still more with their religious belief. Our profound Oriental scholars have
made known to Europeans the refined Sanscrit literature of Hindostan, its schools of
philosophy and astronomy, its dramatic writings and poetry, which are original and
beautiful, and to these the learned in Greece and Italy have contributed.
The riches of Chinese literature, and their valuable geography, were introduced into
Europe by the French Jesuits of the last century, and followed up with success by the
French and English philosophers of the present: to France we also owe much of our
knowledge of the poetry and letters of Persia; and from the time that Dr. Young
deciphered the inscriptions on the Rosetta Stone, Egyptian hieroglyphics and picture-
writing have been studied by the learned of France, England, and Italy, and we have
reason to expect much new information from the more recent researches of Professor
Lepsius of Berlin. The Germans, indeed, have left few subjects of ancient literature
unexplored, even to the language written at Babylon and Nineveh—the most successful
attempt to decipher which is due to a distinguished countryman of our own, Colonel
Rawlinson.
The press has overflowed with an unprecedented quantity of literature, some of
standard merit, and much more that is ephemeral, suited to all ranks, on every
subject, with the aim, in our own country at least, to improve the people, and to
advocate the cause of morality and virtue. All this mental energy is but an effect of
those laws which regulate human affairs, and include in their generality the various
changes that tend to improve the condition of man.
The fine arts do not keep pace with science, though they have not been altogether
left behind. Painting, like poetry, must come spontaneously, because a feeling for it
depends upon innate sympathies in the human breast. Nothing external could affect
us, unless there were corresponding ideas within; poetically constituted minds of the
highest organization are most deeply impressed with whatever is excellent. All are not
gifted with a strong perception of the beautiful, in the same way as some persons
cannot see certain colours, or hear certain sounds. Those elevated sentiments which
constitute genius are given to few; yet something akin, though inferior in degree,
exists in most men. Consequently, though culture may not inspire genius, it cherishes
and calls forth the natural perception of what is good and beautiful, and by that means
improves the tone of the national mind, and forms a counterpoise to the all-absorbing
useful and commercial.
Historical painting is successfully cultivated both in France and Germany. The
Germans have modelled their school on the true style of the ancient masters. They
have become their rivals in richness and beauty of colouring, and are not surpassed in
vividness of imagination, nor in variety and sublimity of composition, which is poetry of
the highest order embodied. Sculpture and architecture are also marked by that
elevated and pure taste which distinguish their other works of art.[200] French artists,
following in the same steps, have produced historical works of great merit. Pictures of
genre and scenes of domestic life have been painted with much expression and beauty
by our own artists; and British landscapes, like some painted by German artists, are
not mere portraits of nature, but pictures of high poetical feeling, and the excellence of
their composition has been acknowledged all over Europe, by the popularity of the
engravings which illustrate many of our modern books. The encouragement given to
this branch of art at home may be ascribed to the taste for a country life so general in
England. Water-colour painting, which is entirely of British growth, has now become a
favourite style in every country, and is brought to the highest perfection in our own.
The Italians have had the merit of restoring sculpture to the pure style which it had
lost, and that gifted people have produced some of the noblest specimens of modern
art. The greatest genius of his time left the snows of the far North to spend his days in
Rome, the head-quarters of art; and our own sculptors of eminent talents have
established themselves in Rome, where they find a more congenial spirit than in their
own country, in which the compositions of Flaxman were not appreciated till they had
become the admiration of Europe. Munich can boast of some of the finest specimens of
modern sculpture and architecture.
The Opera, one of the most refined of theatrical amusements in every capital city in
Europe, displays the excellence and power of Italian melody, which has been
transmitted from age to age by a succession of great composers. German music,
partaking of the learned character of the nation, is rich in original harmony, which
requires a cultivated taste to understand and appreciate.
Italy is the only country that has had two poetical eras of the highest order; and,
great as the Latin period was, that of Dante was more original and sublime. The
Germans, so eminent in every branch of literature, have also been great as poets; the
power of Goethe’s genius will render his poems as permanent as the language in which
they are written. France is, as it long has been, the abode of the Comic Muse; and
although that nation can claim great poets of a more serious cast, yet the language
and the habits of the people are more suited to the gay than the grave style. Though
the British may have been inferior to other nations in some branches of the fine arts,
yet poetry, immeasurably the greatest and most noble, redeems, and more than
redeems us. The nation that produced the poetry of Chaucer, Spenser, Shakespeare
and Milton, with all the brilliant train, down nearly to the present time, must ever hold
a distinguished place, as an imaginative people. Shakespeare alone would stamp a
language with immortality. The British novels stand high among works of imagination,
and they have generally had the merit of advancing the cause of morality. Had French
novelists attended more to this, their knowledge of the human heart and the brilliancy
of their composition would have been more appreciated.
Poetry of the highest stamp has fled before the utilitarian spirit of the age; yet there
is as much talent in the world, and imagination too, at the present time, as at any
former period, though directed to different and more important objects, because the
whole aspect of the moral world is altered. The period is come for one of those
important changes in the minds of men which occur from time to time, and form great
epochs in the history of the human race. The whole of civilized Europe could not have
been roused to the enthusiasm which led them to embark in the Crusades by the
preaching of Peter the Hermit, unless the people had been prepared for it: men were
ready for the Reformation before the impulse was given by Luther; and Pius IX. merely
applied the match to a train already laid. These are the barometric storms of the
human mind.
The present state of transition has been imperceptibly in progress, aided by many
concurring circumstances, among which the increasing intelligence of the lower orders,
and steam-travelling, have been the most efficient. The latter has assisted eminently in
the diffusion of knowledge, and has probably accelerated the crisis of public affairs on
the Continent, by giving the inhabitants of different countries opportunities of
intercourse, and comparing their conditions. No invention that has been made for ages
has so levelling a tendency, which accords but too well with the present disposition of
the people. The spirit of emancipation, so peculiarly characteristic of this century,
appears in all the relations of life, political and social. On the continent of Europe it has
shaken the whole fabric of society, subverted law and order, and ruined thousands, in
order to throw down the crumbling remains of the feudal system. The same
emancipating spirit which has thrown young and old into a state of insubordination and
rebellion abroad, has been quietly but gradually altering the relations of social and
domestic life at home. Parent and child no longer stand in the same relation to one
another; even at an early age boys assume the character and independence of men,
which may perhaps fit them sooner for taking their share in the affairs of the world; for
it must be acknowledged that, whether from early independence or some other cause,
no country has produced more youthful and able statesmen than our own; but, at the
same time, it places them on a less amicable and more dangerous position, by
depriving them of the advice and experience of the aged, to which the same deference
is no longer paid. The working man considers his interest to be at variance with that of
the manufacturer, and the attachment of servants to their masters is nearly as extinct
in Britain as vassalage. Ambition, to a great extent, pervades the inferior and middle
grades of society, and so few are satisfied with the condition in which they were born,
that the pressure upwards is enormous. The numerous instances of men rising from an
inferior rank to the highest offices in the State encourages the endeavour to rise in
society, which is right and natural, if pursued by legitimate means, but the levelling
disposition so prevalent abroad is pernicious as it is impracticable. So long as men are
endowed with different dispositions and different talents, so long will they differ in
condition and fortune, and this is as strongly marked in republics as in any other form
of government; for man, with all his attempts to liberate himself from nature’s
ordinances, by the establishment of equal laws and civil rights, never can escape from
them—inequality of condition is permanent as the human race. Hence, from necessity
we must fulfil the duties of the station in which we are placed, bearing in mind that,
while Christianity requires the poor to endure their lot with patience, it imposes a
heavy responsibility on the rich.
In Britain, respect for the labouring classes, together with active benevolence, form
the counterpoise to the evil propensities of this state of transition; a benevolence
which is not confined to alms-giving, but which consists in the earnest desire to
contribute with energy to the sum of human happiness. In proportion as that
disposition is diffused among the higher classes, and the more they can convince the
lower orders that they have an ardent desire to afford them every source of happiness
and comfort that is in their power, so much sooner will the transient evils pass away,
and an improved state of things will commence; kindly and confiding feelings will then
take the place of coldness and mistrust.
The continual increase of that disinterested benevolence and liberal sentiment, which
in our own country is the most hopeful and consoling feature of the age, manifests
itself in the frequency with which plans for ameliorating the condition of the lower
classes are brought before Parliament; in the societies formed for their relief; and in
the many institutions established for their benefit and comfort.
Three of the most beneficial systems of modern times are due to the benevolence of
English ladies—the improvement of prison discipline, savings-banks, and banks for
lending small sums to the poor. The success of all has exceeded every expectation, and
these admirable institutions are now adopted by several foreign countries. The
importance of popular and agricultural education is becoming an object of attention to
the more enlightened governments; and one of the greatest improvements in
education is, that teachers are now fitted for their duties, by being taught the art of
teaching. The gentleness with which instruction is conveyed no longer blights the
joyous days of youth, but, on the contrary, encourages self-education, which is the
most efficient.
The system of infant-schools, established in many parts of Europe and throughout
the United States of America, is rapidly improving the condition of the people. The
instruction given in them is suited to the station of the scholars, and the moral lessons
taught are often reflected back on the uneducated parents by their children. Moreover,
the personal intercourse with the higher orders, and the kindness which the children
receive from them, strengthen the bond of reciprocal good feeling. Since the abolition
of the feudal system, the separation between the higher and the lower classes of
society has been increasing; but the generous exertions of individuals, whose only
object is to do good, is now beginning to correct a tendency that, unchecked, might
have led to the worst consequences to all ranks. We learn from statistical reports that
the pains taken by individuals and associations are not without their effect upon the
character of the nation. For example, during the eleven years that preceded 1846, in
which the criminal returns indicated the intellectual condition of persons accused, there
were 31 counties in England and Wales in which not one educated woman was called
before a court of law, in a population of 2,617,653 females.[201]
Crime has generally decreased in proportion to the religious and moral education of
the people: the improvement in the morality of the factory-children is immense since
Government appointed inspectors to superintend their health and education;[202] and
indeed the improvement in the condition of the whole population appears from the bills
of mortality, which unquestionably prove that the duration of human life is continually
increasing throughout Great Britain.[203]
The voluntary sacrifices that have been made to relieve the necessities of a
famishing nation evince the humane disposition of the age. But it is not one particular
and extraordinary case, however admirable, that marks the general progress—it is not
in the earthquake or the storm, but in the still small voice of consolation heard in the
cabin of the wretched, that is the prominent feature of the charities of the present
time, when the benevolent of all ranks seek for distress in the abodes of poverty and
vice, to aid and to reform. No language can do justice to the merit of those who
devote themselves to the reformation of the children who have hitherto wandered
neglected in the streets of great cities; in the unpromising task they have laboured
with patience, undismayed by difficulties that might have discouraged the most
determined—but they have had their reward, they have succeeded.[204] The language
of kindness and sympathy, never before heard by these children of crime and
wretchedness, is saving multitudes from perdition. But it would require a volume to
enumerate the exertions that are making for the accommodation, health, and
improvement of the people, and the devotion of high and low to the introduction of
new establishments and the amelioration of the old. Noble and liberal sentiments mark
the proceedings of public assemblies, whether in the cause of nations or of individuals,
and the severity of our penal laws is mitigated by a milder system. Happily this liberal
and benevolent spirit is not confined to Britain, it is universal in the States of the
American Union, and it is spreading widely through the more civilized countries of
Europe.
No retrograde movement can now take place in civilization; the diffusion of Christian
virtues and of knowledge ensures the progressive advancement of man in those high
moral and intellectual qualities that constitute his true dignity. But much yet remains to
be done at home, especially in religious instruction and the prevention of crime; and
millions of our fellow-creatures in both hemispheres are still in the lowest grade of
barbarism. Ages and ages must pass away before they can be civilized; but if there be
any analogy between the period of man’s duration on earth and that of the frailest
plant or shell-fish of the geological periods, he must still be in his infancy; and let
those who doubt of his indefinite improvement compare the first revolution in France
with the last, or the state of Europe in the middle ages with what it is at present. For,
notwithstanding the disturbed condition of the Continent, and the mistaken means the
people employ to improve their position, crime is less frequent and less atrocious than
it was in former times, and the universal indignation it now raises is a strong indication
of improvement. In our own country, men who seem to have lived before their time
were formerly prosecuted and punished for opinions which are now sanctioned by the
legislature, and acknowledged by all. The moral disposition of the age appears in the
refinement of conversation. Selfishness and evil passions may possibly ever be found in
the human breast, but the progress of the race will consist in the increasing power of
public opinion, the collective voice of mankind regulated by the Christian principles of
morality and justice. The individuality of man modifies his opinions and belief; it is a
part of that variety which is a universal law of nature; so that there will probably
always be a difference of views as to religious doctrine, which, however, will become
more spiritual, and freer from the taint of human infirmity; but the power of the
Christian religion will appear in purer conduct, and in the more general practice of
mutual forbearance, charity, and love.
APPENDIX.

Table of the Heights above the Sea of some of the Principal Mountain Chains.
EUROPE.

Heights
Countries
in
Names of Places, Mountains, &c. in which Authorities.
English
situated.
Feet.
Mont Blanc 15,739 Alps, P.[205] P. S.[206]
Monte Rosa 15,210 Alps, L. P. S.
Mont Cervin 14,836 Alps, P. P. S.
Finsterärhorn 14,026 Alps, B. Eichman.
Jungfrau 13,672 Alps, B. Eichman.
Le Géant du M. Blanc 13,786 Alps, P. P. S.
Mont Combin 14,124 Alps, P. P. S.
Mont Iséran 13,272 Alps, G. P. S.
Monte Viso 13,599 Alps, C. P. S.
Ortler Spitz 12,851 Alps, R. A. S.
Le Grand Rioburent 11,063 Alps, M. P. S.
Drey Herrn Spitz 10,122 Alps, Car. A. S.
Mont Terglou 9,386 Alps, J. A. S.

Passes of the Alps:--

Col du Géant 11,238[207] Alps, P. Saussure.


Col de St. Theodule 11,185 Alps, P. P. S.
Pass of Great St. Bernard 8,173 Alps, P. P. S.
Pass of La Furka 8,714 Alps, L. S. S.
Pass of Mont Moro 8,937 Alps, L. P. S.
Pass of Le Tavernette 9,827 Alps, C. P. S.
Pass of Mont Iséran 9,196 Alps, G. P. S.
Pass of Col des Fenêtres 9,581 Alps, P. P. S.
Pass of the Stelvio 9,177 Alps, R. A. S.
Pass of Bernardino 7,015 Alps, R. A. S.
Pass of the Splugen 6,946 Alps, R. A. S.
Pass of St. Gothard 6,808 Alps, R. S. S.
Pass of Mont Cenis 6,772 Alps, G. P. S.
Pass of Simplon 6,578 Alps, L. P. S.
Pass of Tende 6,159 Alps, M. P. S.
Pass of Mont Genèvre 6,119 Alps, C. P. S.
Pass of Brenner 4,659 Alps, R. A. S.
Pass of Pontebba 3,625 Alps, J. A. S.

Malahite Peak 11,168 Pyrenees A. B. L.[208]


Mont Perdu Peak 10,994 Pyrenees A. B. L.
Maboré, Cylinder of 10,899 Pyrenees A. B. L.
Maladetta, Cylinder of 10,886 Pyrenees A. B. L.
Vignemale, Cylinder of 10,820 Pyrenees A. B. L.
Pic du Midi 9,540 Pyrenees A. B. L.
Canigou 9,137 Pyrenees A. B. L.

Passes of the Pyrenees:--

Pass or Port d’Oo 9,843 France A. B. L.


Pass or Port d’Estaube 8,402 France A. B. L.
Pass or Port de Gavarnie 7,654 France A. B. L.
Pass or Port de Tourmalet
7,143 France A. B. L.

Pic de Sancy 6,188 France A. B. L.


Plomb du Cantal 6,093 France A. B. L.
Mont Mezen 5,795 France A. B. L.
Puy de Dôme 4,806 France A. B. L.
Ballon des Vosges 4,688 France A. B. L.
Mont Ventoux 6,263 France A. B. L.
Mulachaçen 11,483 Spain A. B. L.
Sierra de Gredos 10,552 Spain Bory.
Estrella 7,526 Spain Franzini.
Siete Picos 7,244 Spain Bauza.
Peña Laza 8,222 Spain Bauza.
El Gador
6,575 Spain Rojas.
Italy,
Monte Corno, or Gran Sasso d’Italia 9,521
Apennines
Italy,
Monte Vellino 7,851 M. de Prony.
Apennines
Italy,
Termenillo Grande 7,212 Schow.
Apennines
Italy,
Monte Amaro di Majella 9,113 Schow.
Apennines
Italy,
Monte Cimone 6,975 Schow.
Apennines
Mont Amiata 5,794 Tuscany Schow.
Campagna
St. Oreste or Soracte 2,140 Schow.
of Rome.

Passes of the Appennines:--

Pass of Noviordi Giovi 1,550 Schow.


Pass of La Bochetta 2,550 Schow.
Pass of Pietramala 3,294 Schow.

Islands of the Mediterranean:--

Monte Rotondo 8,767 Corsica A. B. L.


Monte d’Oro 8,701 Corsica A. B. L.
Monte Generargenta 6,004 Sardinia La Marmora.
Mount Etna 10,874 Sicily W. H. Smyth.
Pizzo di Cane 6,509 Sicily A. B. L.
Mount Eryx 3,894 Sicily A. B. L.
Stromboli 2,687 Lipari Isles De Borch.

Greece and Morea:--

Mount Guiona 8,538 Peytier.[209]


Parnassus 8,068 Peytier.
Taygetus, Mont St. Elias 7,904 Peytier.
Mont Olonas 7,293 Peytier.
Mont Kelmos 7,726 Peytier.
Mont Athos 6,778 De Borch.
Mont Helicon 5,738 Peytier.
Delphi 5,725 Peytier.
Mont Hymettus 3,378 Peytier.

Central Europe:--

Ruska Joyana 9,912 E. Carpaths. Malte Brun.


Budosch, Transylvania 9,593 E. Carpaths. A. B. L.
Surrul 9,593
Mount Tatra; highest point 8,524 W. Carpaths. Wahlenberg.
Mount Tatra; Csabi Peak 8,314 W. Carpaths. Wahlenberg.
Mount Tatra; Lomnitz 8,861 W. Carpaths. A. B. L.
Riesenhoppe, in the Riesengeberge 5,394 Germany Horen.
French
Feldberg, in the Schwarzwald 4,675 Germany
Engineers.
French
Belchenberg, in the Schwarzwald 4,642 Germany
Engineers.
Kandelberg, in the Schwarzwald 4,160 Germany Bohnenberger.
Schneeberg, Geisengebirge 4,784 Germany
Kammkoppel, Geisengebirge 4,265 Germany Charpentier.
Sonnenwerbel, in the Erzgebirge 4,124 Germany
Rachelberg, in the Böhmerwald 4,561 Germany Sternberg.
Steinberg, Moravia 3,511 Germany David.
Brocken, Hartz 3,658 Germany Zach.
Schneeberg, in the Fichtelgebirge 3,461 Germany Goldfuss.
Blessberg, in the Thuringerwald 2,748 Germany Zach.
Glockner, in the Thuringerwald 2,231 Germany Zach.
Gross Feldberg, in the Taunus chain 2,775 Germany Schmidt.
Lowenberg, in the Siebengebirge 2,024 Germany Nose.

Norway and Sweden:--


Scandinavian
Skagtöltend Lat. 61° 24ʹ 8,101 Keilhau.
Mountains
Scandinavian
Koldetind 7,224 Keilhau.
Mountains
Scandinavian
Sognefield 7,182 Hagelstam.
Mountains
Scandinavian
Mugnafield Lat. 61° 20ʹ 7,215 Forsell.
Mountains
Scandinavian
Schneehattan Lat. 62 20 8,120 Eismark.
Mountains
Scandinavian
Pighœttan Lat. 62 2 6,788 Hagelstam.
Mountains
Scandinavian
Sulitelma Lat. 67 5 6,178 Wahlenberg.
Mountains
Scandinavian
Langfield Lat. 61 53 6,598 Hagelstam.
Mountains
Scandinavian
Melderskin Lat. 60 0 4,859 Von Buch.
Mountains
Lyngen Scandinavian
Lat. 69 30 4,300 Von Buch.
Mountains Mountains

Great Britain:--

Ben Nevis 4,380 Scotland Jameson.


Cairntoul, Aberdeenshire 4,223 Scotland Playfair.
Ben Avon, Aberdeenshire 3,931 Scotland Playfair.
Ben More, Grampians 3,819 Scotland Playfair.
Schehallien, Grampians 3,514 Scotland Playfair.
Snowdon 3,557 Wales Roy.
Cader Idris 3,550 Wales Roy.
Carn Llewellyn 3,471 Wales Roy.
Cross Fell, Cumberland 3,383 England Jameson.
Helvyllen, Cumberland 3,313 England Jameson.
Skiddaw, Cumberland 3,038 England Dr. Young.
Schunner Fell, Yorkshire 2,388 England Smith.
Coniston Fell, Lancashire 2,575 England Smith.
Cheviot Hills 2,657 England Smith.
Pentland Hills 1,878 Scotland Playfair.
Curran Tual, Kerry 3,412 Ireland Nimmo.
Sleib Donnard 3,146 Ireland Nimmo.
Nephin, Mayo 2,644 Ireland Jameson.
Mourne Mountains, Down 2,493 Ireland Jameson.
Ben More, Isle of Mull 3,100 Hebrides Jameson.
Hecla, Isle of S. Uist 3,002 Hebrides Boué.
Cuchullin, Isle of Skye 2,995 Hebrides M’Culloch.
Mount Rona 3,593 Shetland Laing.
Iceland and Feroe:--

Snœfials, Jokull 5,115 Iceland A. B. L.


Hecla 3,324 Iceland A. B. L.
Skalingefield, Isle Stromoe 2,172 Feroe Stein.
ASIA.
Names of Places, Heights in Countries in which
Authorities.
Mountains, &c. English Feet. situated.

Himalaya Chain:—

Kunchinginga, W. Col. Waugh.


28,178 Sikim [210]
part
Kunchinginga, E.
27,826 Sikim Col. Waugh.
Peak
Dwalagari 26,862 Nepaul Webb.
Juwahir 25,670 Kumaöon Herbert.
Jumoo 25,312 Sikim Waugh.
Jumnautri 25,500 Nepaul Webb.
Dhaibun 24,740 Nepaul Webb.
Kabroo 24,005 Sikim Waugh.
Chamalari 23,929 Tibet Waugh.
Powhunry 23,176 Sikim Waugh.[210]
Momonangli, or Gurla 23,500 Tibet Strachey.[211]
Api Peak 22,799 Nepaul Webb.

Peak No. 12 23,263 Webb.


Between the Kali and
Peak No. 13 22,313 Webb.
E. branch of the
Peak No. 23 22,727 Webb.
Ganges.
Peak No. 25 22,277 Webb.

St. George’s Peak 22,500 Webb.


Between the Ganges
St. Patrick’s Peak 22,638 Webb.
and Sutlej.
Gungoutri Pyramid 21,219 Webb.

Jownlee Peak
21,940 Kumaöon Webb.
(highest)
Kailas Peak 21,000 Tibet Strachey.
Kohibaba 17,905 Hindoo Cush Burnes.
Peak N. of Cabul 20,232 Hindoo Cush Burnes.

Passes of the Himalaya:


Dr.
Karokorum Pass 18,600 Tibet
Thomson[212]
Parangla Pass 18,500 Tibet Cunningham.
Kronbrung Pass 18,313 Tibet Gerard.
Langpya Dhura or
17,750 Tibet Strachey.
Doora Ghaut
Lipu Lek Pass 16,884 Tibet Manson.
Niti Ghaut Pass 16,814 Tibet Gerard.
Paralaha Pass 16,500 Tibet Webb.
Shatool Pass 15,500 Tibet Webb.

Elbrouz 18,493 Caucasus Fuss.


Kasbeck 16,530 Caucasus A. C.[213]
Demavend 14,695 Persia Thomson.
Ararat 17,112 Persia Parrot.
Argæus 13,197 Asia Minor A. C.
Beloukha 11,062 Altai A. C.
Mount Lebanus 9,517 Syria A. B. L.
Mount Horeb 8,593 Syria Rüppell.
Mount Sinai 7,498 Syria Rüppell.
Jebel Serbal 6,760 Syria Rüppell.
Kamen Peak 5,397 Ural A. C.
Tremel Peak 5,071 Ural A. C.
AFRICA, AND ISLANDS IN THE ATLANTIC.

Heights in Countries in
Names of Places, Mountains, &c. English which Authorities.
Feet. situated.
Mount Atlas (Miltsin) 11,400 Morocco Washington.
Mount Abba
13° 10’ N 15,008 Abyssinia Rüppell.
Jarrat
Mount
13 12 N 14,362 Abyssinia Rüppell.
Buahat
Abyssinia in
Kilimandjaro 4 0 S 20,000 the Mtns. of Ans. of Phil.
the Moon.
(doubtful.)
Cape of Good
Table Mountain 3,816 A. B. L.
Hope.
Pico Ruivo 6,056 Madeira Vidal.
Peak of Teyde, Teneriffe 12,172 Canaries. Von Buch.
Chahorra, Teneriffe 9,885 Canaries. Von Buch.
Pico de Cruz, Palma 7,730 Canaries. Vidal.[214]
Los Pexos, Great Canary 6,400 Canaries. Vidal.
Alto Garaona, Gomera 4,400 Canaries. Vidal.
San Anton, Ferro 3,907 Canaries. Vidal.
Asses’ Ears, Fuestaventura 2,770 Canaries. Vidal.
Cape Verde
Peak of Fogo 9,154 Deville.
Islands.
Cape Verde
Pico, Island of San Antonio 8,815 Capt. King.
Islands.
Pico, Island of Pico 7,613 Azores Vidal.
Pico de Vara, Island of St.
3,570 Azores Vidal.
Michael’s
Caldeira de Sta. Barbara, Terceira 3,500 Azores Vidal.
Pico de San Jorje 3,498 Azores Vidal.
Morro Gordo, Flores 3,087 Azores Vidal.
Caldeira de Corvo 2,460 Azores Vidal.

You might also like