100% found this document useful (8 votes)
272 views

Java: A Beginner's Guide: Create, Compile, and Run Java Programs Today 9th Edition Herbert Schildt - eBook PDF 2024 scribd download

Java

Uploaded by

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

Java: A Beginner's Guide: Create, Compile, and Run Java Programs Today 9th Edition Herbert Schildt - eBook PDF 2024 scribd download

Java

Uploaded by

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

Visit https://ebookluna.

com to download the full version and


explore more ebooks

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


Java Programs Today 9th Edition Herbert Schildt -
eBook PDF

_____ Click the link below to download _____


https://ebookluna.com/download/java-a-beginners-guide-
create-compile-and-run-java-programs-today-ebook-pdf/

Explore and download more ebooks at ebookluna.com


Here are some recommended products that might interest you.
You can download now and explore!

Java: A Beginner’s Guide 7th Edition Herbert Schildt -


eBook PDF

https://ebookluna.com/download/java-a-beginners-guide-ebook-pdf/

ebookluna.com

Java: A Beginner’s Guide, Eighth Edition Herbert Schildt -


eBook PDF

https://ebookluna.com/download/java-a-beginners-guide-eighth-edition-
ebook-pdf/

ebookluna.com

Java: The Complete Reference 12th Edition Herbert Schildt


- eBook PDF

https://ebookluna.com/download/java-the-complete-reference-ebook-pdf/

ebookluna.com

(eBook PDF) Building Java Programs: A Back to Basics


Approach 5th Edition

https://ebookluna.com/product/ebook-pdf-building-java-programs-a-back-
to-basics-approach-5th-edition/

ebookluna.com
Building Java Programs: A Back to Basics Approach 4th
Edition (eBook PDF)

https://ebookluna.com/product/building-java-programs-a-back-to-basics-
approach-4th-edition-ebook-pdf/

ebookluna.com

Building Java Programs: A Back to Basics Approach 4th


Edition Stuart Reges - eBook PDF

https://ebookluna.com/download/building-java-programs-a-back-to-
basics-approach-ebook-pdf/

ebookluna.com

Building Java Programs - A Back to Basics Approach 5th


Edition Stuart Reges - eBook PDF

https://ebookluna.com/download/building-java-programs-a-back-to-
basics-approach-ebook-pdf-2/

ebookluna.com

(eBook PDF) Building Java Programs: A Back to Basics


Approach 4th Edition by Stuart Reges

https://ebookluna.com/product/ebook-pdf-building-java-programs-a-back-
to-basics-approach-4th-edition-by-stuart-reges/

ebookluna.com

(eBook PDF) Java Software Solutions 9th Global Edition

https://ebookluna.com/product/ebook-pdf-java-software-solutions-9th-
global-edition/

ebookluna.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


Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
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


Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
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


Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
Other documents randomly have
different content
condition that his picture, with that of his dog, be perpetually
preserved in painted glass in one of the windows of the church;
which the parishioners carefully performed in the south east
window of the middle isle. Maitland.
Lambeth Butts, Lambeth.
Lambeth Marsh, between Lambeth and Spring Gardens.
Lambeth road, Newington Butts.
Lambeth School, was founded by Richard Laurence, citizen and
merchant of London, in the year 1661, for educating twenty poor
children of the Marsh and Wall liberties of this parish, for which
purpose he endowed it with 35l. per annum.
Lambeth stairs, Lambeth.
Lancaster college, in the parish of St. Gregory near St. Paul’s, was a
hall founded by King Henry IV. and the executors of John of Gaunt,
Duke of Lancaster; containing lodgings and a common hall for
charity priests to officiate in a chapel, on the north side of the
choir of St. Paul’s cathedral; but it was suppressed, and granted to
one Mr. William Gunter, in the second year of Edward VI. Maitland.
Duchy of Lancaster Court, held at Gray’s Inn. This court owes its
origin to King Henry IV. after his having deposed Richard II. when,
possessing the duchy of Lancaster in right of his mother, he
imagined his claim to it better than that to the throne, and
therefore separated it from the Crown, and erected this court for
its use. Here all matters of law and equity, belonging to the duchy
or county palatine of Lancaster, are tried and determined by the
Chancellor, who is the chief judge, and is assisted by his attorney
general, and other officers. Maitland.
Duchy of Lancaster Liberty, begins on the outside of Temple Bar, and
extending along the south side of the Strand to the east side of
Cecil street, reaches down it to the Thames, and thence to Essex
Buildings, taking in all the houses to Temple Bar. On the north side
it extends from Temple Bar to where the Maypole stood, and
extending down Holiwell street, commonly called the back of St.
Clement’s, passes by Butcher row, taking in all that range of
buildings. Beyond the place of the Maypole, this liberty begins
again by the Fountain tavern in Catharine street, and reaches from
thence into the Strand, as far as Exeter exchange; then turning up
Burleigh street, it runs up within four houses of the corner of
Essex street, and, crossing it, proceeds into Catharine street, by
the Fountain tavern. Stow, last edit.
Lancaster court, 1. New Bond street. 2. In the Strand.
Lancaster yard, Holiwell street.
Land of Promise lane, Hoxton.
Landress alley, Five feet lane.
Lane’s alley, St. Giles’s Broadway.†
Lane’s court, Cold Bath square, by Cold Bath fields.†
Langbourn Rivulet, a brook which formerly took its rise in or near the
east end of Fenchurch street, and ran with a swift current due
west, to Sherbourn lane, at the west end of St. Mary Woolnoth;
then dividing its stream into several rills, ran directly south, and
was lost in the Wall Brook, on Dowgate hill. Maitland.
Langbourn Ward, took its name from the Langbourn, or rivulet above-
mentioned. It is bounded on the north by Aldgate and Lime street
wards; on the west, by Wallbrook ward; on the south, by
Candlewick, Bridge, Billingsgate, and Tower street wards; and on
the east, by Aldgate ward. Its principal streets are great part of
Fenchurch street, and Lombard street, Exchange alley, Birchinlane,
&c.
The most remarkable buildings are, the churches of St. Mary
Woolnoth, St. Edmund the King, Allhallows Lombard street, and St.
Dionis Backchurch; the General Post office, Pewterers hall, and the
hall belonging to the Hudson’s Bay company.
This ward is governed by an Alderman, his Deputy, ten Common
Council men, seventeen wardmote inquest men, nine scavengers,
fifteen constables, and a beadle; and the jurors returned by the
wardmote inquest serve in the several courts of Guildhall in the
month of November.
Langdon’s rents, Bett’s street.
Langley Park, near Langley Green, in Buckinghamshire, belongs to the
Duke of Marlborough. The late Duke began to build a new house
of stone in this park, but one of the wings is yet wanting to
compleat the design, which is more remarkable for its elegance
than grandeur.
Langley street, 1. Long Acre.† 2. Whitecross street.†
Lang’s court, St. Martin’s lane.†
Lassingby’s court, Conduit court, Long Acre.†
Last alley, 1. Cow Cross, West Smithfield.* 2. Whitechapel.*
Last and Ball court, London Wall.*
Latimers, a hamlet with a chapel of ease to Chesham in Bucks,
received its name from its ancient Lords. In this hamlet lived Sir
Edwyn Sands, whose daughter having four sons and nine
daughters by her husband Sir Thomas Temple, ancestor of the
present Earl Temple, lived to see 700 descended from her, and
died in 1656. The Lord James Cavendish has here a seat.
Lavender street, near Cuckold’s Point.
Laughton’s rents, Cinnamon street.†
St. Lawrence Jewry, on the north side of Cateaton street, in Cheap
ward, is thus denominated from its being dedicated to St.
Lawrence, a native of Huesca in the kingdom of Arragon in Spain,
who, after having suffered the most dreadful torments under the
Emperor Valerian, was cruelly broiled alive upon a gridiron, with a
slow fire, till he died: and it received the additional epithet of
Jewry, from its situation among the Jews, who formerly resided in
the streets near that church; to distinguish it from St. Lawrence
Poultney, now demolished. Maitland.
This church being burnt, with many others, in the dreadful fire
of London in 1666, was rebuilt at the parish expence, with a very
considerable benefaction by Sir John Langham.
It is eighty-one feet long, sixty-eight broad, forty feet high to the
roof, and the steeple 130 feet high. The body is enlightened by
two series of windows, the lower ones large and uniform, and the
upper small. At the east end is a pediment with niches supported
by Corinthian columns. The tower, which is lofty, is terminated by a
balustrade with plain pinnacles, and within this balustrade rises a
kind of lanthorn, which supports the base of the spire.
This church is a vicarage in the gift of the Master and Scholars
of Baliol college in Oxford, and the profits of the Incumbent are
much augmented by the parish of St. Mary Magdalen Milk street
being annexed to it: he receives 120l. a year from the parish, and
20l. from Baliol college.
Lawrence lane, 1. From Cheapside to Cateaton street, near the above
church. 2. High street, St. Giles’s. 3. New street Lambeth.
St. Lawrence Poultney, on the west side of St. Lawrence Poultney’s
lane, was so denominated from the above saint, and Mr. John
Poultney, who founded a college there; but the church being
consumed in the general conflagration in 1666, and not rebuilt, the
parish was united to that of St. Mary Abchurch.
Lawrence Poultney hill, Canon street.†
Lawrence Poultney lane, Canon street.†
Lead Office, in Ingram’s court, Fenchurch street. This office belongs
to a company incorporated by letters patent granted by King
William and Queen Mary in the year 1692, under the title of The
Governor and Company for melting down lead with pit and sea
coal. By this patent they are empowered to raise a joint stock for
the effectual carrying on the business of smelting, or drawing lead
from the ore with sea coal instead of wood.
This corporation is under the direction of a Governor, Deputy
Governor, and twelve Assistants. Maitland.
Leadenhall, a very large building of great antiquity in Leadenhall
street, with flat battlements leaded at the top, and a spacious
square in the middle. In this edifice are the warehouse for the
selling of leather, the Colchester baize hall, the meal warehouse,
and the wool hall.
Leadenhall Market, the largest market in the city of London, and
perhaps in Europe, consists of five considerable squares, or courts,
the first of which opens by a large Gothic gate into Leadenhall
street. This court, which is surrounded by the buildings called
Leadenhall, is surrounded with sheds for butchers, tanners, &c. As
there is but little meat sold here except beef, this is called the Beef
market. This square is on Tuesday a market for leather; on
Thursdays the waggons from Colchester, and other parts, come
with baize, &c. and the felmongers with wool; on Fridays it is a
market for raw hides, and on Saturdays for beef.
Behind this market are two others separated by a range of
buildings of a considerable length, with shops and rooms on each
side. In both these are principally sold small meat, as mutton,
veal, lamb, and pork, and some of the shops sell beef. In the
easternmost of these markets is a market house supported on
pillars, with vaults underneath, and rooms above, with a clock and
a bell tower, and underneath are sold various sorts of provision.
Beyond these is a very spacious market for fowl. There is another
called the Herb-market, which has an entrance into Leadenhall
street, but this does not succeed. The passages into the above
markets from Lime street and Gracechurch street, are filled with
the dealers in provisions of various kinds.
Leadenhall street extends from the end of Cornhill, at the corner of
Gracechurch street, to Aldgate street within.
Leather lane, Holborn.
Leatherdressers yard, Paul’s Alley.
Leatherhead, or Letherhead, a small town in Surry, situated about four
miles to the S. W. of Epsom. It had formerly a market, which has
been discontinued above an hundred years. Here is a bridge over
the river Mole, which having sunk into the earth near Mickleham,
at the foot of Boxhill, rises again near this town, and runs through
Cobham, to the Thames at Moulsey. ’Tis pleasantly situated on a
rising bank by the side of the river, and in as good a situation for
riding or hunting as most within twenty miles of London, it having
a fine, open, dry, champaign country almost all round it.
Leathersellers, a company incorporated by letters patent granted by
Henry VI. in the Year 1442. They are governed by a Prime, and
three Wardens, with twenty-six Assistants, and an hundred and
fifty-six liverymen, who at their admission pay a fine of 20l. each.
By a grant of Henry VII. the Wardens of this corporation, or their
deputies, were impowered to have the inspection of sheeps,
lambs, and calves leather throughout the kingdom, in order the
more effectually to prevent frauds in those commodities.
Leathersellers hall in Little St. Helen’s, was part of the convent of
nuns dedicated to St. Helen, and considering the antiquity of its
building, has some of the best joiners and plaisterers work in the
kingdom. The entrance into the common hall is up a handsome
flight of stone steps from the court yard. The screen is
magnificently adorned with six columns of the Ionic order,
enrichments, &c. and the ceiling enriched with fretwork.
Boyle’s Lecture. See the article Boyle’s Lecture.
Lee’s Almshouse, upon the Narrow Wall, Lambeth, was erected by
Gerard Van Lee; and Valentine Van Lee, who was probably his son,
gave the eight poor inhabitants of this house, the sum of 5l. per
annum, for the term of five hundred Years. Maitland.
Lee’s court, 1. St. Catharine’s lane.† 2. Hockley in the Hole.†
Lee’s street, Red Lion square, Holborn.†
Leg alley, 1. Barnaby street.* 2. Long Acre.* 3. Shoreditch.* 4.
Tooley street.*
Leg court, Peter street, Westminster.*
St. Leger’s wharf, Tooley street.†
Legget’s walk, Upper Ground.†
Leicester fields, a very handsome square, the inner part of which is
enclosed with iron rails, and adorned with grass plats and gravel
walks, in the center of which is an equestrian statue of his present
majesty gilt. The buildings with which this square is surrounded,
are very good, especially the north side, where is Leicester house,
once the seat of the Earl of Leicester, and now inhabited by her
Royal Highness the Princess Dowager of Wales. This is a large
brick building, neat and commodious, though not magnificent. It
has a spacious court before, and a fine garden behind it; there is
here a good collection of pictures; and from this house the square
is denominated. Next to this edifice is the house of Sir George
Savile, Bart. in which his Royal Highness the Prince of Wales
resides at present.
Leicester street, 1. By Leicester fields.☐ 2. Liquorpond street. 3.
Warwick street, Haymarket.
Leigh’s court, St. Catharine’s lane.†
Leith Hill, near Boxhill in Surry, admired for affording one of the
noblest prospects in all Europe, of which Mr. Dennis gives a lively
description in his Letters familiar, moral and critical; we shall
therefore transcribe his words. “In a late journey,” says he, “which
I took into the Wild of Sussex, I passed over an hill which shewed
me a more transporting sight than ever the country had shewn me
before, either in England or Italy. The prospects which in Italy
pleased me most, were that of the Valdarno from the Apennines;
that of Rome, and the Mediterranean from the mountains of
Viterbo; of Rome at forty, and the Mediterranean at fifty miles
distance from it; and that of the Campagne of Rome from Tivoli
and Frescati; from which two places you see every foot of that
famous Campagne, even from the bottom of Tivoli and Frescati to
the very foot of the mountain of Viterbo, without any thing to
intercept your sight. But from an hill which I passed in my late
journey into Sussex, I had a prospect more extensive than any of
these, and which surpassed them at once in rural charms, in
pomp, and in magnificence. The hill which I speak of, is called
Leith Hill, and is about five miles southward from Darking, about
six from Box Hill, and near twelve from Epsom. It juts itself out
about two miles beyond that range of hills which terminate the
north downs to the south. When I saw from one of these hills, at
about two miles distance that side of Leith Hill which faces the
northern downs, it appeared the beautifullest prospect I had ever
seen: but after we had conquered the hill itself, I saw a sight that
would transport a stoic; a sight that looked like enchantment and
vision. Beneath us lay open to our view all the wilds of Surry and
Sussex, and a great part of that of Kent, admirably diversified in
every part of them with woods, and fields of corn and pastures,
every where adorned with stately rows of trees.
“This beautiful vale is about thirty miles in breadth, and about
sixty in length, and is terminated to the south by the majestic
range of the southern hills, and the sea: and it is no easy matter
to decide, whether these hills, which appear at thirty, forty, fifty
miles distance, with their tops in the sky, seem more aweful and
venerable, or the delicious vale between you and them more
inviting. About noon, in a serene day, you may at thirty miles
distance, see the very water of the sea through a chasm of the
mountains. And that which above all makes it a noble and a
wonderful prospect, is, that at the same time that, at thirty miles
distance, you behold the very water of the sea; at the same time
that you behold to the south, the most delicious rural prospect in
the world; at that very time, by a little turn of your head towards
the north, you look full over Box Hill, and see the country beyond
it, between that and London; and, over the very stomacher of it,
see St. Paul’s at twenty-five miles distance, and London beneath it,
and Highgate and Hampstead beyond it.”
Lemon street, 1. Goodman’s fields. † 2. Lowman’s Pond row,
Southwark.†
Lemontree yard, Bedfordsbury.*
St. Leonard’s Eastcheap, was dedicated to Leonard, a French saint,
and mighty miracle-monger, and stood on the east side of Fish
street hill, near Little Eastcheap; but being destroyed by the fire of
London in 1666, and not rebuilt, the parish is annexed to that of
St. Bennet’s Gracechurch street. Maitland.
St. Leonard’s Foster lane, was dedicated to the above-mentioned
saint, and stood on the west side of Foster lane, Cheapside; but
suffering in the fatal catastrophe of 1666, and not being rebuilt,
the parish is annexed to that of Christ’s Church.
St. Leonard’s Shoreditch. There was a church in this place dedicated
to the same saint in very early times, and there are records of a
dispute concerning itz in the reign of Henry II. The last structure,
which was a very mean heavy pile, stood till the year 1735, when
the inhabitants having the year before applied to parliament, it
was pulled down, and the present light and elegant edifice was
soon after erected in its room. Strype’s edit. of Stow.
To this church there is an ascent by a double flight of plain
steps, which lead to a portico of the angular kind supported by
four Doric columns, and bearing an angular pediment. The body of
the edifice is plain, but well enlightened, and the steeple light,
elegant and lofty. The tower at a proper height has a series of
Ionic columns, and on their entablature are scrolls which support
as many Corinthian columns placed on pedestals, and supporting a
dome, from whose crown rises a series of columns of the
Composite order, on whose entablature rests the spire standing
upon four balls, which give it an additional air of lightness; and on
the top, as usual, is a ball and fane.
This church is both a rectory and a vicarage; but the distinct
rights of the Rector and Vicar are said to be not thoroughly
ascertained; however the profits of the vicarage amount to about
350l. a year.
Leopard alley, Saffron hill.*
Leopard’s court, Baldwin’s Gardens.
Lester’s yard, Bluegate fields.†
Leveridge’s yard, Nightingale lane.†
Lewisham, a town in Kent, situated on the river Ravensburn, between
Blackheath and Surry. Here are two free schools, of which the
Leathersellers company in London are Governors.
Lewis’s yard, 1. Greenbank, Wapping.† 2. Saffron hill.†
Leydon street, Shadwell market.†
Lidier’s court, Saltpetre bank.†
Lifeguard yard, Oxford street.
Lilley’s alley, Saffron hill.†
Lillipot lane, Noble street, Foster lane.†
Limehouse, was anciently a village above two miles distant from the
city of London, though it is now joined by a continued chain of
buildings: its original name was Limehurst, which has been
corrupted to Limehouse, This, according to Mr. Stow, is a Saxon
word signifying a grove of lime trees, and it was given to this
village, on account of the number of those trees anciently in that
neighbourhood.
Limehouse bridge, Limehouse.
Limehouse causeway, Limehouse.
Limehouse corner, Limehouse.
Limehouse dock, Narrow street, Limehouse.
Limehouse Fore street, at the end of Ratcliff Narrow street.
Limehouse Hole, Limehouse.
Limehouse Hole stairs, Limehouse.
Limehouse Hole street, Limehouse.
Limehouse road, White Horse street.
Limekiln dock, Limehouse.
Limekiln hill, Limehouse.
Limekiln yard, Limehouse.
Lime street, extends from Leadenhall street into Fenchurch street,
and is thus called from its being anciently a place where lime was
either made or sold. Maitland.
Lime Street square, Lime street.
Lime Street Ward, is very small, and is bounded on the north and east
by Aldgate ward; on the south by Langbourn ward; and on the
west, by Bishopsgate ward. It is observable that there is no
church, nor whole street in this ward, though it runs through
several parishes. Its principal buildings are the East India House,
and Leadenhall.
To this ward belong an Alderman and four Common Council
men, including the Deputy, four constables, two scavengers,
sixteen wardmote inquest men, and a beadle. The jurymen
returned by the wardmote inquest serve as jurors in the several
courts in Guildhall, in the month of November.
Lime Tree court, Narrow wall, Southwark.‡
Limpsfield, a village near Croydon in Surry, in the Kent road.
Lincoln’s Inn, one of the four Inns of Court, is situated on the west
side of Chancery lane, where formerly stood the houses of the
Bishop of Chichester and of the Black Friars, the latter erected
about the year 1222, and the former about 1226; but both of them
coming to Henry Lacey, Earl of Lincoln, he built in their room a
stately mansion for his city residence. It however afterwards
reverted to the bishopric of Chichester, and was demised by Robert
Sherbourn, Bishop of that see, to Mr. William Syliard, a student
there, for a term of years; after the expiration of which Dr. Richard
Sampson, his successor, in the year 1536 passed the inheritance
thereof to the said Syliard and Eustace his brother; and the latter,
in 1579, in consideration of the sum of 500l. conveyed the house
and gardens in fee to Richard Kingsmill and the rest of the
benchers.
The charge of admission into this house, including fees, amount
to 5l. and every student, after studying there seven years, is
admitted to the bar. The members are obliged to be a fortnight in
commons every term, on the penalty of paying 18s. in case of
absence. Stow. Maitland.
Lincoln’s Inn principally consists of three rows of good buildings,
all taken up by gentlemen of the society. These form three sides of
the square, and here the buildings are all new and uniform, the
north side lying open to the gardens, which are greatly improved
with gravel walks, grass plats, rows of trees, and a very long
terrace walk, which affords a fine prospect of Lincoln’s Inn Fields.
In the middle of the square is a neat fluted Corinthian column in a
small bason surrounded with iron bars. This column supports a
handsome sun dial, which has four sides, and on the corners of
the pedestal are four naked boys spouting water out of Tritons’
shells. This is one of the neatest squares in town, and tho’ it is
imperfect on one side, that very defect produces a beauty by
giving a prospect of the gardens, which are only separated from it
by iron rails, and fill the space to abundantly more advantage. No
area is kept in better order for cleanliness and beauty by day, or
illuminations and decorum by night. The fountain in the middle is a
pretty decoration. The print represents as much of the square as
could be taken in the visual angle at one view, with the fountain in
the middle, as it appears coming into it from Portugal row. This is
one of the most considerable Inns of Court possessed by the
gentlemen of the law. Here is a good hall and chapel of Gothic
architecture. The latter was built by Inigo Jones, who
notwithstanding his skill and reputation in architecture, could not
persuade them to have it in any other stile.
The above gardens, which are extremely pleasant and
commodious, are, like those of Gray’s Inn, laid open for public use;
the greatest part of the west side of the square is taken up with
the offices belonging to the stamp duty. See Stamp Office.
A little behind the north east side of the square is the above
chapel, which was built about the year 1622 or 1623, on pillars,
with an ambulatory or walk underneath, paved with broad stones.
This walk, particularly when illuminated by the lamps, inspires the
mind with a kind of melancholy pleasure, that may be better felt
than described. The outside of the chapel is a good piece of Gothic
architecture, and the windows are painted with the figures at full
length of the principal personages mentioned in the sacred
Scriptures. On the twelve windows on the north side, are
Abraham, Moses, Eli, David, and the prophets Daniel, Isaiah,
Jeremiah, Ezekiel, Amos, and Zachariah, with John the Baptist, and
St. Paul, and on the south side are the rest of the Apostles. Under
these figures are the arms of a great number of the gentlemen
belonging to this society. The colours in these paintings being
extremely bright and beautiful, it is not at all surprizing that these
pictures on glass should be much admired, though the designs are
in reality but poor, and there is little expression in the faces.
In the old buildings fronting the garden beyond the square, is
the library, which consists of a good collection of books in several
languages and faculties.
S. Wale delin. J. Fougeron sculp.
Lincoln’s Inn.

Lincoln’s Inn Fields, is universally allowed to be the largest, and one


of the most beautiful squares in London, if not in Europe. It is
encompassed on three sides by houses, and on the east by the
wall of the terrace of Lincoln’s Inn garden. The north side is called
Newman’s row, the west side Arch row, the south side Portugal
row, and the east side Lincoln’s Inn wall. This square was originally
laid out by the masterly hand of Inigo Jones, and it is said that the
sides of it are the exact measure of the great Pyramid of Egypt. It
was intended to have been built all in the same stile; but there
were not a sufficient number of people of taste, to accomplish so
great a work. The house which was late the Duke of Ancaster’s, is
built on this model; but elevated and improved so as to make it
more suitable to the quality of the owner. It has that simple
grandeur which characterises all the designs of the celebrated
Inigo Jones. The print here given of it may serve to convey some
idea not only of this particular house, but of the noble appearance
which the whole square would have made had it been all built
after this fine design.
Some of the houses however in this square are grand and noble,
but they are far from having that beauty which arises from
uniformity. The square is now adorned with a fine bason in the
middle, well supplied with water; and with grass plats and gravel
walks, encompassed with an iron pallisade fixed upon a stone
plinth, at a proper distance from the buildings.
Lincoln’s Inn gate, on the south side of Lincoln’s Inn square.
Lincoln’s Inn passage, on the west side of Lincoln’s Inn square.
Linton’s court, Near New Gravel lane.†
Linton’s lane, Newington Butts.†
Linton’s yard, Milk yard, Shadwell.†
Lion and Lamb alley, Golden lane.*
Lion’s court, Lutener’s Lane.†
Lion’s Inn, anciently a common Inn, with the sign of the Lion, is one
of the Inns in Chancery, and is situated between Holiwell street
and Wych street. It is a member of the Inner Temple, and is
governed by a Treasurer and twelve Ancients, who with the other
members are to be three weeks in commons in Michaelmas term,
and a fortnight in each of the rest. Chamberlain’s Present State.
Maitland.
Lion’s Inn court, Lion’s Inn.*
Lion’s key, Thames street.†
Lion’s street, Bloomsbury.†
Lion’s yard, Whitecross street.†
Liquorpond street, Leather lane.
Lisle street, Prince’s street, Soho.†
Lissham Green, a pleasant village near Paddington.
Litchfield street, Soho.
Little Almonry, by the Great Almonry, Westminster; so named from
the alms given there. See the next article.
Little Almonry Almshouse, situated in the Little Almonry, was founded
by Henry VII. for the accommodation of twelve poor watermen
and their wives, who annually receive of the Dean and Chapter of
Westminster 7l. 2s. 4d. each couple, with a purple gown every
other year; and for the burial of a Duke, Marquis, or their Ladies in
the Abbey, 1l. 6s. 6d. and for that of an Earl, Baron, or their
Ladies, 10s. 6d.
Little St. Andrew’s street, Seven Dials.
Little St. Ann’s lane, 1. Old Pye street. 2. Peter street, Westminster.
Little Argyle street, Argyle street, Great Marlborough street.†
Little Arthur street, Great Arthur street, Goswell street.†
Little Ashentree court, Water lane.‡
Little Ayliff street, Goodman’s Fields.†
Little Bacon street, Brick lane.†
Little Bailey street, Little Tower hill.†
Little Bandyleg walk, Queen street.
Little Bartholomew Close, Little Britain.
Little Bear key, Thames street. See Bear key.
Little Bell alley, 1. Coleman street.* 2. Grub street.*
Little Bennet’s court, Marygold court.†
Little Black Horse court, Aldersgate street.
Little Booth street, Coverley’s fields.
Little Boss alley, Thames street.
Little Brick lane, Nicol’s street.
Little Bridges street, Bridges street.†
Little Britain, extends from Aldersgate street to Duck lane. This was
anciently called Britain street, from the Duke of Britany’s palace
situated in it near St. Botolph’s church.
Little Broad street, Broad street, London wall.
Little Brook’s street, Grosvenor square.†
Little Bush lane, Thames street.
Little Bur street, Nightingale lane, East Smithfield.†
Little Cable street, 1. Cable street, Rag Fair.† 2. Wellclose square.†
Little Carter lane, Old Change.†
Little Castle street, Winsley street.*
Little Catharine street, In the Strand.
Little Chandos street, St. Martin’s lane.
Little Chapel street, 1. Great Wardour street. 2. By New Chapel
street, Westminster.
Little Cheapside, Three Cranes, Thames street.
Little Cheapside yard, Three Crane alley.
Little Cock alley, 1. Redcross street, Cripplegate.* 2. Whitecross
street, Cripplegate.*
Little Cock hill, Ratcliff.†
Little court, 1. Duke’s Place, by Aldgate. 2. St. Mary Overies church
yard.
Little Crow alley, Whitecross street, Cripplegate.*
Little Crowder’s Well alley, Jewin street.
Little Crown alley, Long Alley, Moorfields.*
Little Dean’s court, St. Martin’s le Grand.
Little Dean’s yard, Dean’s Yard, Westminster.
Little Dice key, Thames street.
Little Distaff lane, Old Change.
Little Drury lane, in the Strand.
Little Duke’s Place, or court, Leadenhall street.
Little Dunning’s alley, near Bishopsgate street.†
Little Earl street, Seven Dials.†
Little Eastcheap, Gracechurch street.
Little Elbow lane, 1. In Great Elbow lane, Thames street. 2. Ratcliff.
Little Essex street, Essex street, in the Strand.
Little Flower de Luce court, Cowcross.*
Little Friars gate, Fleet street, leading to White Friars.
Little Friday street, Friday street, Cheapside.
Little George street, 1. Great George street, Conduit street. 2. Great
George street, Spitalfields.
Little Gloucester court, Chequer alley, Whitecross street.
Little Gloucester street, Whitecross street, Cripplegate.
Little Gray’s Inn lane, Gray’s Inn lane, Holborn.
Little Greenwich, Aldersgate street.
Little Greenwich alley, Aldersgate street.
Little Grosvenor street, Grosvenor square.
Little Gun alley, Orchard, Wapping.*
Little Hart street, near Covent Garden.
Little St. Helen’s, Bishopsgate street. See St. Helen’s.
Little St. Helen’s Almshouse, was erected by the Leathersellers
company, pursuant to the will of John Hasilwood, of Waltham, Esq;
in the year 1544, for the reception of four men and three women,
who were allowed by the founder only 8d. per week each; but by
other benefactions, and the bounty of the company, they now
receive 2s. weekly, and six bushels of coals at Christmas. Maitland.
Little St. Helen’s court, Bishopsgate street within.
Little Hermitage street, Wapping.
Little Hollis’s street, Hanover square.†
Little Howard’s yard, Angel alley.†
Little Jermain street, St. James’s street.
Little John’s street, Davis’s street.
Little Island, New Gravel lane.
Little Ivy lane, Ivy lane.‡
Little King’s Head court, near Shoe lane, Fleet street.
Little King’s street, St. James’s street.
Little Kirby street, Hatton garden.†
Little Knightrider street, Great Knightrider street, by Addle hill.
Little Lamb alley, Blackman street.*
Little Last alley, East Smithfield.*
Little Lombard street, Lombard street, by the Mansion house.
Little Love lane, Wood street, Cheapside.
Little Maddox street, New Bond street.
Little Marlborough street, Carnaby street.
Little Marsh yard, near Wapping.
Little St. Martin’s lane, Charing Cross.
Little Match walk, Upper Shadwell.
Little Maypole alley, St. Margaret’s hill.
Little Mazepond street, in the Maze.
Little Minories, that part of the Minories which is railed in, and is out
of the city liberties. See the article Minories.
Little Minories court, Little Minories.
Little Mitchell’s street, Old street.†
Little Montague court, Little Britain.
Little Montague street, 1. Crispin street, Spitalfields. 2. Pelham street.
Little Moorfields, Fore street, Moorgate.
Little Moor yard, St. Martin’s lane, Charing Cross.†
Little Mouse alley, East Smithfield.
Little New court, Lamb alley.
Little Newport street, Great Newport lane.
Little New street, New street, Shoe lane.
Little New Street hill, near Shoe lane.
Little Nightingale lane, Burr street.
Little Northumberland alley, Crutched Friars.
Little Nottingham street, Dyot street.
Little Old Bailey, Great Old Bailey.
Little Ormond street, 1. Southampton row. 2. Red Lion street,
Holborn.
Little Ormond yard, Ormond street.
Little Pearl street, Lamb street, Spitalfields.*
Little Peter street, 1. Little Windmill street. 2. Tufton street.
Little Portland street, Portland street.
Little Prescot street, Goodman’s fields.†
Little Prince’s street, 1. Near High Holborn. 2. Old Soho.
Little Queen street, 1. Dean street, Soho. 2. High Holborn. 3. King
street, Rotherhith. 4. Queen street, Wapping. 5. Westminster.
Little Rider’s court, Little Newport street.†
Little Rider street, St. James’s street.†
Little Rope walk, Goswell street.
Little Russel street, 1. Bloomsbury. 2. Drury lane.
Little Rutland court, Addle hill.
Little Sanctuary, King street, Westminster.
Little Scotland yard, Whitehall.
Little Sheer lane, Sheer lane, Temple bar.
Little Smith street, Smith street, Marsham street.†
Little Spring street, Spring street, Shadwell.
Little Star alley, Mark lane.*
Little Stone stairs, Ratcliff.
Little Suffolk street, Haymarket.
Little Swallow street, Swallow street.
Little Swan alley, 1. Coleman street.* 2. Goswell street.* 3. Mount
Mill.* 4. St. John’s street, West Smithfield.* 5. Three colts yard,
London Wall.*
Little Swordbearers alley, Chiswell street.
Little St. Thomas Apostle’s lane, Queen street, Cheapside.
Little Thompson’s rents, Half Moon alley, Coleman street.†
Little Three Tun alley, Near Whitechapel.*
Little Tower Hill, At the bottom of the Minories.
Little Tower street, At the west end of Tower street.
Little Trinity lane, In Trinity lane, Bow lane.
Little Turnstile alley, High Holborn.
Little Twyford’s alley, St. Ermin’s hill.†
Little Vine street, Vine street.*
Little Wardour street, Tweed street.
Little Warner street, Cold Bath fields.†
Little Warwick street, Cockspur street.
Little White Bear court, Black Friars.*
Little White Lion street, Seven Dials.*
Little Wild street, Great Wild street.†
Little Winchester street, London Wall.
Little Windmill street, Near Cambridge street.
Little Wood street, Cripplegate.
Little York street, Cock lane, Shoreditch.
Littleton street, Golden lane.†
Litton street, Golden lane.†
Lloyd’s court, 1. Denmark street, Soho.† 2. Hog lane, St. Giles’s.†
Lloyd’s street, Prince’s street, Soho.†
Lloyd’s yard, Skinner’s street.†
Lock Hospital, near Hyde Park Corner, for the cure of the venereal
disease. This charitable foundation was established, and is still
supported by the voluntary contributions of gentlemen, who have
had the humanity to consider, that pain and misery, however
produced, entitle frail mortals to relief from their fellow creatures.
They therefore, in imitation of the munificence of the Almighty,
who causes his sun to shine on the evil and the good, afford relief
equally to the innocent and the guilty.
Patients were first received into this hospital on the 31st of
January 1747, since which time to the 10th of March 1752, there
were discharged from it 1432; besides those who received benefit
from it, by being out-patients; and the in-patients cured from the
10th of March 1752, to the 10th of March 1753, amounted to 308;
besides twenty-one cured as out-patients. In that year four died,
and at that last period, there were forty patients in the house, and
five out-patients.
Among the above unhappy objects were several married
women, children and infants, many of whom were admitted by the
weekly committee, even without any other recommendation than
their distress, they being almost naked, pennyless and starving.
The virtuous, the humane reader will be astonished at reading,
that at the end of the above period, among the other miserable
objects who found relief, were upwards of sixty children from two
to ten or twelve years old, who became infected from ways little
suspected by the generality of mankind; from the absurd opinion,
imbibed by the lower class, both males and females, that by
communicating this loathsome disease to one that is sound, they
will get rid of it themselves; and from this principle, which is
contradicted by daily experience, the most horrid acts of barbarity
have been frequently committed on poor little infants; and thus
these vile wretches have entailed the most dreadful disease on
these innocent infants, without affording the least relief to
themselves. This the Governors have thought their duty to publish,
in order, as much as possible, to root out from among mankind an
opinion at once so base, so false, and productive of such cruelty.
From the above account of the happy success of this charity, its
great usefulness must appear extremely obvious to every humane
well disposed person: and many such may be induced to
contribute to it, when they are informed that any sum not less
than a guinea a year, will be acceptable.
Every gentleman subscribing 5l. a year, or upwards, is a
Governor of this hospital; and whoever gives a benefaction of 50l.
at one time, is a Governor for life: but no Governor above two
years in arrear, can have any power or privilege as a Governor, till
he has paid his arrears.
A committee of at least five of the Governors meet every
Saturday morning at ten o’clock, to admit and discharge patients,
adjust the weekly accounts, receive the reports of the visitors, and
examine the affairs of the house.
Two of the contributors are appointed weekly by the committee
to examine every day into the behaviour of the patients and
nurses, and make their report, as it shall appear to them, at the
next weekly board.
The orders of the house are:
I. That no patient is to be admitted but who brings a
recommendation in writing, signed by a Governor, or one of the
weekly committee.
II. That all recommendations for the admission of patients are
received every Saturday morning till eleven o’clock.
III. Every patient is obliged to submit to the rules and orders of
the house, or be discharged for irregularity.
IV. No person discharged for irregularity, can ever be received
into the house again, on any recommendation whatsoever.
V. That no Governor have more than one patient in the house at
a time; and that a preference be always given to those who
subscribe the largest sums, so far as the case of the patient will
admit.
VI. That no nurse, or any other person belonging to this
hospital, do presume to take any reward whatsoever from any
patient, either at their admission, continuance in the house, or
discharge out of it, on pain of being immediately expelled, by
order of the next weekly board.
VII. That no security at the admission of any patient be required
for his burial; but when any patient dies in the hospital, he or she
shall be buried at the expence of the society, unless it be
otherwise desired by the friends of the deceased.
The contributors are desired to send their subscriptions to the
Treasurer at the weekly board, held every Saturday morning in the
hospital; and in order to supply the current expence of the charity,
the subscribers are requested to pay their annual subscriptions in
advance.
There is a poor’s box in the public hall, for the reception of small
sums, or from such as are not willing to have their names inserted
in the list of subscribers.
Lock Hospital, at the south east corner of Kent street, in Southwark,
was anciently a house for the reception and cure of lepers: but at
present it belongs to St. Bartholomew’s hospital in this city, and
with the Lock at Kingsland, is appropriated to the cure of venereal
patients.
It is a small neat edifice, and has been lately rebuilt. It has a
row of trees before, and a garden behind, with a wall next the
street. At the south end is the chapel, built about an hundred and
twenty years ago.
Lock Hospital, at Kingsland. See Kingsland.
Lockwood’s yard, Saffron hill.†
Lodise’s alley, Saltpetre Bank.†
Lodise’s court, Saltpetre Bank.†
Logsdown yard, Middle row, Holborn.
Lollards Tower, the southernmost of two stone towers which stood at
the west of St. Paul’s cathedral before the fire of London; which
being used as the Bishop of London’s prison for such as were
found guilty of the supposed crime of maintaining opinions
contrary to the faith of the church of Rome, and many of the
followers of Wickliff, who were called Lollards, being here
imprisoned, it obtained the name of the Lollards Tower. Among
these persecuted people were Mr. Richard Hunne, a citizen of
London, a person well beloved, and of a fair character, who in the
year 1515 was imprisoned here, under the pretence of having
Wickliff’s bible; tho’ the occasion of his ruin was a dispute he had
with a clerk about a mortuary, which was made the cause of the
whole clergy. This man however submitted to the Bishop’s
correction, upon which he ought to have been enjoined penance
and set at liberty; but he was found hanging in his chamber, with
his neck broken; and the Bishop’s sumner owned that he, with Dr.
Horsey the Bishop’s chancellor, and the bell-ringer, had committed
the murder. Upon this the coroner’s inquest proceeded to trial; but
the Bishop began a new process against the dead body for heresy,
and his persecutors not satisfied with having him murdered,
caused the corpse to be burnt in Smithfield. Maitland.
Lollards Tower, at Lambeth. See Lambeth.
Lombard court, 1. Seven Dials. 2. West street, Soho.
Lombard street, 1. On the back of Cornhill, extends from the mansion
house of the Lord Mayor, to Gracechurch street. Lombard street
was anciently, as well as at present, inhabited by bankers, the first
of whom were Italians chiefly from Lombardy, whence the word
Lombards became anciently applied to all bankers, and this street
retained the name of Lombards or Bankers street. Stow. 2. In
Coverley’s fields. 3. In White Friars. 4. In the Mint, Southwark.

The End of the Third Volume.


Transcriber’s Notes:
Some of the illustrations have been moved
to be closer to their descriptions.
The decorative line that separates chapters
was missing from chapter “L”. Perhaps
because it is the only chapter, after the first,
that begins at the top of a page. The
decorative line from an earlier chapter was
used.
There is no section for streets and buildings
beginning with the letter “I”. They are mixed
in with the “J”s.
Missing or obscured punctuation was silently
corrected.
Typographical errors were silently corrected.
Inconsistent spelling and hyphenation were
made consistent only when a predominant
form was found in this book.
*** END OF THE PROJECT GUTENBERG EBOOK LONDON AND ITS
ENVIRONS DESCRIBED, VOL. 3 (OF 6) ***

Updated editions will replace the previous one—the old editions


will be renamed.

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


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

START: FULL LICENSE


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

To protect the Project Gutenberg™ mission of promoting the


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

Section 1. General Terms of Use and


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

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


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookluna.com

You might also like