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

Java the UML way integrating object oriented design and programming Else Lervik - Download the full set of chapters carefully compiled

The document promotes the ebook 'Java the UML Way: Integrating Object-Oriented Design and Programming' by Else Lervik and Vegard B. Havdal, available for download at ebookultra.com. It includes links to additional recommended ebooks related to object-oriented design and programming. The document also provides detailed information about the book's content, structure, and authors.

Uploaded by

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

Java the UML way integrating object oriented design and programming Else Lervik - Download the full set of chapters carefully compiled

The document promotes the ebook 'Java the UML Way: Integrating Object-Oriented Design and Programming' by Else Lervik and Vegard B. Havdal, available for download at ebookultra.com. It includes links to additional recommended ebooks related to object-oriented design and programming. The document also provides detailed information about the book's content, structure, and authors.

Uploaded by

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

Visit https://ebookultra.

com to download the full version and


explore more ebooks or textbooks

Java the UML way integrating object oriented


design and programming Else Lervik

_____ Click the link below to download _____


https://ebookultra.com/download/java-the-uml-way-
integrating-object-oriented-design-and-programming-else-
lervik/

Explore and download more ebooks or textbooks at ebookultra.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Object Oriented Design with UML and Java 1st Edition


Kenneth Barclay

https://ebookultra.com/download/object-oriented-design-with-uml-and-
java-1st-edition-kenneth-barclay/

Object Oriented Software Engineering Using UML Patterns


and Java 2nd Edition Bernd Bruegge

https://ebookultra.com/download/object-oriented-software-engineering-
using-uml-patterns-and-java-2nd-edition-bernd-bruegge/

Applying UML and Patterns An Introduction To Object


Oriented Programming 2Ed Edition Larmen

https://ebookultra.com/download/applying-uml-and-patterns-an-
introduction-to-object-oriented-programming-2ed-edition-larmen/

Scientific Software Design The Object Oriented Way 1st


Edition Damian Rouson

https://ebookultra.com/download/scientific-software-design-the-object-
oriented-way-1st-edition-damian-rouson/
Java Methods Object Oriented Programming and Data
Structures Third AP 3rd AP Edition Maria Litvin

https://ebookultra.com/download/java-methods-object-oriented-
programming-and-data-structures-third-ap-3rd-ap-edition-maria-litvin/

Introduction to Programming with Greenfoot Object Oriented


Programming in Java with Games and Simulations 1st Edition
Michael Kolling
https://ebookultra.com/download/introduction-to-programming-with-
greenfoot-object-oriented-programming-in-java-with-games-and-
simulations-1st-edition-michael-kolling/

Beginning C Object Oriented Programming 2nd Edition Dan


Clark

https://ebookultra.com/download/beginning-c-object-oriented-
programming-2nd-edition-dan-clark/

Object Oriented Programming in C 4th Edition E.


Balagurusamy

https://ebookultra.com/download/object-oriented-programming-in-c-4th-
edition-e-balagurusamy/

Object oriented software development using Java principles


patterns and frameworks 2nd Edition Xiaoping Jia.

https://ebookultra.com/download/object-oriented-software-development-
using-java-principles-patterns-and-frameworks-2nd-edition-xiaoping-
jia/
Java the UML way integrating object oriented design and
programming Else Lervik Digital Instant Download
Author(s): Else Lervik, Vegard B. Havdal
ISBN(s): 9780470854884, 047085488X
Edition: English language ed
File Details: PDF, 58.13 MB
Year: 2002
Language: english
This page intentionally left blank
Java the UML Way
Integrating Object-Oriented Design and Programming

Else Lervik and Vegard B. Havdal


S0r Trondelag University College, Trondheim, Norway

Translated and sponsored by tisip

JOHN WILEY & SONS, LTD


V: tlSlD
'
First published in the Norwegian language as Programmering i Java, © 2000 Else Lervik and Vegard B. Havdal,
The TISIP Foundation, and Gyldendal Akademisk

English language edition


Copyright © 2002 by John Wiley & Sons Ltd,
Baffins Lane, Chichester,
West Sussex PO 19 1UD, England

National 01243 779777


International (+44) 1243 779777
e-mail (for orders and customer service enquiries): cs-books@wiley.co.uk
Visit our Home Pag on http://www.wileyeurope.com

All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by
any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except under the terms of the Copyright,
Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright Licensing Agency Ltd, 90 Tottenham Court
Road, London, UK W1P OLP, without the permission in writing of the Publisher with the exception of any material supplied
specifically for the purpose of being entered and executed on a computer system for exclusive use by the purchaser of the
publication.

Neither the authors nor John Wiley & Sons, Ltd accept any responsibility or liability for loss or damage occasioned to any person
or property through using the material, instructions, methods or ideas contained herein, or acting or refraining from acting as a
result of such use. The authors and publisher expressly disclaim all implied warranties, including merchantability or fitness for
any particular purpose. There will be no duty on the authors or publisher to correct any errors or defects in the software.

Designations used by companies to distinguish their products are often claimed as trademarks. In all instances where John Wiley
& Sons, Ltd is aware of a claim, the product names appear in capital or all capital letters. Readers, however, should contact the
appropriate companies for more complete information regarding trademarks and registration.

Library of Congress Cataloguing in Publishing Data (applied for)

British Library Cataloguing in Publication Data

A catalogue record for this book is available from the British Library

ISBN 0 470 84386 1

Typeset by Cybertechnics Ltd, Sheffield


Printed and bound in Great Britain by Biddies Ltd, Guildford and King's Lynn
This book is printed on acid-free paper responsibly manufactured from sustainable forestry,
in which at least two trees are planted for each one used for paper production.
Contents
Preface xi

1 Introduction 1
1.1 Preliminaries for Reading This Book 2
1.2 Contemplating a Computer 3
1.3 Java Applications and Java Applets 5
1.4 JavaScript and JSP 6
1.5 How This Book is Structured 7
1.6 A Small Example Program 9
1.7 Examples of Applets 15
1.8 New Concepts in This Chapter 17
1.9 Review Problems 19
1.10 Programming Problems 20
2 Variables, Data Types, and Expressions 21
2.1 Example 22
2.2 Data and Variables 22
2.3 Algorithms, Programming Errors, and Test Data 26
2.4 Statements, Blocks, and Names 28
2.5 Variables and Constants 30
2.6 Data Types 34
2.7 Assignments and Arithmetical Expressions 40
2.8 Type Conversion 43
2.9 Calculations for Our Renovation Project 45
2.10 New Concepts in This Chapter 47
2.11 Review Problems 49
2.12 Programming Problems 49
3 Using Ready-Made Classes 51
3.1 Objects as Models of Reality 52
3.2 Using Ready-Made Classes 55
3.3 The Random Class 60
3.4 The String Class 63
3.5 Organizing Classes in Packages 70
3.6 Class Methods and Class Constants in the Java Library 71
3.7 Reading Data from the User 73
3.8 New Concepts in This Chapter 77
3.9 Review Problems 79
3.10 Programming Problems 79
4 Constructing Your Own Classes 81
4.1 Creating Classes 82
4.2 Programming a Class 85
4.3 Access Modifiers - Private and Public 91
Contents

4.4 Contents of a Class 92


4.5 One More Class and Some New Operators 101
4.6 Introduction to Applets 106
4.7 Introduction to Graphics 111
4.8 New Concepts in This Chapter 118
4.9 Review Problems 120
4.10 Programming Problems 121
Selection as a Control Structure 123
5.1 A Simple Calculator 124
5.2 A Selection is a Control Structure 126
5.3 Blocks inside Methods 131
5.4 The if Statement 133
5.5 Nested if and Multiple-Choice Statements 137
5.6 Boolean Expressions 144
5.7 The Multiple-Choice Statement switch 150
5.8 Comparing Computed Decimal Numerals 153
5.9 The Conditional Operator ?: 153
5.10 New Concepts in This Chapter 154
5.11 Review Problems 155
5.12 Programming Problems 156
Loops as a Control Structure 159
6. 1 Counter-Controlled Loops 160
6.2 A Loop with a General Condition 163
6.3 A Graphics Example 166
6.4 The for Statement 168
6.5 Nested Control Structures 169
6.6 The do-while Statement 171
6.7 Choosing the Right Loop Statement 173
6.8 Controlling Input Data 174
6.9 New Concepts in This Chapter 177
6.10 Review Problems 178
6.11 Programming Problems 178

Collaboration Between Objects 181


7. 1 Examples of Collaboration Between Objects 182
7.2 A Menu-Driven Program 190
7.3 Several References to the Same Object 197
7.4 Summary: Argument Passing 202
7.5 New Concepts in This Chapter 205
7.6 Review Problems 205
7.7 Programming Problems 205

8 Java Libraries and Exception Handling 207


8. 1 The Online API Documentation 208
8.2 Making Your Own Libraries 211
8.3 Localization 214
8.4 Sound and Images 218
Contents

8.5 Introduction to Exception Handling 220


8.6 Exception Handling in Detail 226
8.7 New Concepts in This Chapter 236
8.8 Review Problems 236
8.9 Programming Problems 237
9 Arrays of Primitive Data Types 239
9.1 What is an Array? 240
9.2 Copying Arrays 244
9.3 The Month Class for Precipitation Data 247
9.4 Sorting 251
9.5 Searching 255
9.6 The java.util.Arrays Class 256
9.7 Two-Dimensional Arrays 258
9.8 More Than Two Dimensions 265
9.9 Multidimensional Arrays and Object-Oriented Programming 266
9.10 New Concepts in This Chapter 267
9.11 Review Problems 268
9.12 Programming Problems 268
10 Arrays of Reference Types and Array Lists 271
10.1 An Array of Reference Type 272
10.2 Array Lists 275
10.3 Wrapper Classes - Integer, Double, etc. 278
10.4 The Methods - equals() and toStringQ 281
10.5 Associations 283
10.6 A Bigger Example 285
10.7 The Comparable and Comparator Interfaces 296
10.8 Sorting Arrays and Array Lists 298
10.9 New Concepts in This Chapter 304
10.10 Review Problems 305
10.11 Programming Problems 305
11 Using Data Files and Streams 307
11.1 Data Files and Streams 308
11.2 An Example of a Data File 309
11.3 Reading Text from a File 311
11.4 Writing Text to a File 315
11.5 Data Files: Summary and Class Descriptions 316
11.6 Reading Numbers from a Data File 320
11.7 Communication with the Console 323
11.8 Binary Transfer of Data 323
11.9 Random Access to the Contents of a File 325
11.10 Serialization 329
11.11 New Concepts in This Chapter 335
11.12 Review Problems 355
11.13 Programming Problems 336
Contents

12 Inheritance and Polymorphism 339


12.1 Generalization and Specialization 340
12.2 Inheritance 342
12.3 The Material Class with Subclasses 345
12.4 Handling Instances of Subclasses as a Whole 351
12.5 The Renovation Case with Many Surfaces and Many Materials 354
12.6 What if Polymorphism Didn' t Exist? 357
12.7 The Protected Access Modifier 360
12.8 Two Levels of Inheritance 364
12.9 Rules and Syntax 369
12.10 Interface 372
12.11 New Concepts in This Chapter 376
12.12 Review Problems 377
12.13 Programming Problems 378

13 GUI Programming and Events 383


13.1 GUI Components 384
13.2 Pushing a Button 388
13.3 Inner Classes 395
13.4 Managing the Layout 402
13.5 New Concepts in This Chapter 412
13.6 Review Problems 413
13.7 Programming Problems 413

14 Text, Choices, and Windows 415


14. 1 Text Components and Focus Listeners 416
14.2 Giving the User a Choice Between Alternatives 423
14.3 Choices Using Check Boxes 425
14.4 Choices Using Radio Buttons 428
14.5 Choices Using Lists 431
14.6 Windows 439
14.7 Making a Window 441
14.8 Differences Between Applets and Applications 446
14.9 Other Ways to Program Listeners 448
14. 10 New Concepts in This Chapter 450
14.11 Review Problems 451
14.12 Programming Problems 451

15 Creating User Interfaces 453


15.1 Menus 453
15.2 Toolbars 458
15.3 Dialog Windows 461
15.4 GridBagLayout as Layout Manager 476
15.5 The Table GUI Component (the JTable Class) 481
15.6 GUI for the Renovation Project 484
15.7 New Concepts in This Chapter 495
15.8 Review Problems 495
15.9 Programming Problems 496
Contents

16 Threads 499
16.1 Threads in Processes 500
16.2 Dividing Time Between Threads 502
16.3 Example of Threads in Use 503
16.4 Thread States 507
16.5 Communication Between Threads 508
16.6 Locks and Synchronization 510
16.7 More Control: wait(), notify(), and notifyAll() 515
16.8 Peeking at the Threads with JDB 519
16.9 New Concepts in This Chapter 521
16.10 Review Problems 522
16.11 Programming Problem 522

17 Data Structures and Algorithms 523


17.1 Graphs 524
17.2 Lists 526
17.3 The Solution: Collection, List, and Linked List 534
17.4 Queues and Stacks 538
17.5 Recursion 540
17.6 Trees 542
17.7 Trees in the API 550
17.8 Hashtables 553
17.9 New Concepts in This Chapter 558
17.10 Review Problems 559
17.11 Programming Problems 559

18 More about Applets 561


18.1 What Applets Do on the Web 561
18.2 Security 562
18.3 Programming an Applet 565
18.4 Security in Practice 570
18.5 Communication Between Applet and Browser 572
18.6 New Concepts in This Chapter 575
18.7 Review Problems 576
18.8 Programming Problems 576

19 Distributed Systems with Socket Programming and RMI 579


19.1 Sockets 580
19.2 Objects That Collaborate over a Network 586
19.3 How Does Communication Between the Objects Occur? 594
19.4 RMI and Applets 600
19.5 Deployment Diagram 600
19.6 A Distributed System with Callback 603
19.7 New Concepts in This Chapter 614
19.8 Review Problems 615
19.9 Programming Problems 615
Contents

20 Programming with Databases 619


20.1 Database Drivers 620
20.2 Establishing Contact with a Database 621
20.3 A Bigger Example 628
20.4 A Database Application 634
20.5 The Three-Layer Architecture 640
20.6 Transactions and Compiled SQL Statements 641
20.7 New Concepts in This Chapter 645
20.8 Review Problems 645
20.9 Programming Problems 646

21 Web Programming with JavaServer Pages 649


21.1 Different Ways of Programming for the Web 650
21.2 Installing Software 651
21.3 Servlets 652
21.4 JavaServer Pages (JSP) 657
21.5 What Does JSP Consist of? 658
21.6 Inputting Data from the User 662
21.7 Client-Side Validation with JavaScript 671
21.8 Databases 672
21.9 Storing State Information 680
21.10 New Concepts in This Chapter 695
21.11 Review Problems 696
21.12 Programming Problems 697

Appendices
A Using Java SDK and WinEdit 699
A.1 SDK 699
A.2 Running Applets 703
A.3 WinEdit 703

B Keywords 705
C Number Systems 707
D The Unicode Character Set 711
E HTML and Applets 713
F Exceptions to the Code Standard 717
References 719

Index 721
This textbook was designed for higher education in technological fields where Java
and object-orientation form the basis of programming education. This book covers
both basic and more advanced programming.
The book assumes a general familiarity with computers, operating systems, and
the most common tools (such as, for example, word processors and browsers).
Readers should be familiar with concepts like "file" and "directory" and know the
difference between internal memory (RAM) and storage (for example, the hard
disk).

A foundation in object-orientation
When using Java as an educational language, it makes sense for readers to deal with
object-oriented ways of thinking as soon as possible. To a large extent, modern
programming consists of using ready-made components and classes. It's possible
to make a Java program that draws geometric figures, displays images, and plays
sound files without using anything more complicated than sequential control
structure. We believe that graphics and graphical user interfaces will motivate
further study into both object-orientation and programming in general, more so
than difficult control structures and textual user interfaces.
Readers will be introduced to the Java API for the first time in chapter 3. We'll
introduce the standard JOptionPane class which makes it possible to create
programs with primitive graphical user interfaces. We'll also use the Random and
String classes. This will teach readers to use ready-made classes and at the same
time provide a general introduction to object-oriented ways of thinking.
Once readers have used ready-made classes, we believe they will want to find out
what these classes look like inside. We devote quite a bit of space to creating our
own classes, a broad and comprehensive topic. In chapter 4, the readers will get to
create their own applets with simple geometrical figures where they can control the
shape, colors, and fonts themselves.
With this as a foundation, more classes follow to demonstrate the need for
selection and loop control structures.
Preface

Object-oriented thinking and modeling go hand in hand with programming


throughout this whole book. Nevertheless, for beginners to be able to run Java
programs, their first read-through of the book will probably focus on programming
details. Later perusals will contribute more to readers lifting their gazes up beyond
the details of the code.
Using ready-made classes is part of developing the ability to think abstractly and
understand encapsulation. We've chosen to make do with this in the first half of
the book. We consider event handling, which is required to write programs with
"real" graphical user interfaces, to be so complicated that the time for it comes only
after most of the pieces of the Java language and object-orientation in general are
in place. If it is included too early on, we believe that the degree of "mystery"
behind it remains too high.

This book is not just for beginners


Because of an early, and therefore very thorough focus on object-orientation, we
believe that this book is suited to professional programmers with backgrounds in
non-object-oriented solution methods and programming languages. These readers
will be able to sail through many of the programming details in the earlier chapters
and concentrate instead on the object-orientation aspect, as illustrated with simple
code examples.
Readers with backgrounds from another object-oriented programming
language, C++ for example, will recognize quite a bit in the first part of the book.
They should, however, peruse this material quickly, primarily because there are a
number of essential differences between Java and C++, but also because the
conceptual apparatus differs somewhat between the two languages. Examples of
where Java differs from C++: in Java, arrays are objects with built-in knowledge of
their own length, exceptions are thrown if you try to refer to an array element with
an invalid index, space has to be allocated for all objects using the new operator
(you cannot put objects on the stack), objects that no longer have references are
removed automatically, it's not possible to program true multiple inheritance,
there's no operator-overloading, it's not possible to manipulate pointers, etc.
Java's rich Application Programming Interface (API) will be of particular interest
to readers with backgrounds in other languages. The Swing library makes it
possible to create platform-independent graphical user interfaces. The classes for
managing strings and arrays of dynamic length are easy to use. Familiar data
structures such as linked lists, trees, and hashtables are built in as part of the Java
API. Remote Method Invocation (RMI) makes it easy to create distributed systems
in the form of objects that cooperate over the network. Java Database Connectivity
(JDBC) is a collection of classes that can communicate via database drivers with
just about any database system. JavaServer Pages (JSP) is a technique for
programming dynamic Web pages. The programs run on the web server and
generate customized Web pages.
Unified Modeling Language (UML) as a modeling language
One of the most welcome events in recentyears in the field of object-oriented analysis
and design was when three gentlemen, Booch, Jacobson, and Rumbaugh, joined
forces and created a single common modeling language, Unified Modeling Language
(UML). This language is a standard accepted by the Object Management Group
(OMG), and we will gradually introduce elements of the language as we proceed.
We start with a class diagram that illustrates a single class in chapter 3, and gradually
add more classes using associations and generalizations. We use an activity diagram
to illustrate control structures, threads, and other parallel processes. Sequence
diagrams are very convenient for showing how objects send messages to each other.
In the last few chapters of the book, we use deployment diagrams to show how the
different parts of a distributed system depend on each other and run on physically
different machines.

Software
The software necessary for writing Java programs can be downloaded free from the
Internet. This book builds on the Java 2 SDK. The SDK is available on Sun's Web
pages (http://java.sun.com/). This book explains how the package is used. In
addition, you'll need a good editor. Alternatively, you can use an integrated
development environment, for example JBuilder Foundation, which you can get
from Borland's pages on the Internet (http://www.borland.com/jbuilder/).
To develop dynamic Web pages with JavaServer Pages (chapter 21), the reader
needs a web server. The book gives instructions on installation and use of a free
web server, LiteWebServer from http://www.gefionsoftware.com/.

Resource page on the Internet


This book has its own Internet page, http://www.tisip.no/JavaTheUmlWay/, where
you'll find all the examples, as well as answers to all the shorter problems and
many of the programming problems. The page also includes a number of relevant
links.

Teaching aids
The book includes several teaching aids: every chapter starts with the chapter's
learning goals and ends with a list of the new concepts introduced, review
problems, and more involved programming problems. In addition, most
subchapters end with shorter problems, where the reader is encouraged to actively
work with the material that was just covered.
The book's Internet page (see above) includes a set of overheads that go with
each chapter. The overheads are based primarily on the book, but also contain
some examples and figures not found in the book.
Preface

The book's structure


The basics
The first nine chapters provide the requisite foundation in programming.
The first chapter introduces the topics of programming and Java and lays out the
prerequisites we're assuming the readers have. This chapter also covers the various
typographical elements used in the book.
Chapter 2 provides a necessary introduction into the topics of variables, data
types, and expressions. Chapters 3 and 4 focus on object-orientation and the goal
of the chapters is for the readers to learn to use ready-made classes and to make
their own classes. Readers will become familiar with important object-oriented
concepts like servers, clients, attributes, messages, and operations. They will
understand that there's a difference between objects in reality and objects in
programs. Readers will create their own first applets with simple geometrical figures
in chapter 4.
Chapters 5 and 6 cover the control structures of selection and loops.
Object-orientation is again the focus in chapter 7, where we'll look at message
exchanges between objects. This requires a thorough understanding of how
arguments are passed between objects, and we'll go through a number of
programming details, some of them difficult.
We now believe the reader is ready to use the online documentation that comes
with the SDK. Chapter 8 offers a brief introduction to this. Using the ready-made
classes that come with the SDK requires familiarity with exception handling in Java.
Therefore, this is also covered in chapter 8.
Chapter 9 covers arrays of primitive data types. Simple sorting and searching are
discussed. The chapter also covers the use of ready-made methods for this purpose.

Intermediate topics
This part of the book will prepare readers to make comprehensive programs with
graphical user interfaces. This requires extensive use of the Java API and a thorough
understanding of the concepts in an object-oriented system (such as associations
and generalizations, for example).
Arrays of reference types are essentially different in their structure and behavior
from arrays of primitive data types. Therefore, we've chosen to treat these in a
separate chapter along with the ArrayList class, which is a class that hides
reference arrays with dynamic lengths. For many practical purposes, this class is
better suited than an ordinary array of reference type. Chapter 10 also covers classes
with prepared sort-and-search methods including classes that make it possible to
take a country's character sets into consideration.
Chapter 10 introduces further relationships between objects in the form of
associations. We emphasize a demonstration of the transition from class diagram
to program code.
Chapter 11 deals with communication between programs and data files. The
chapter covers both text and binary transfers as well as direct access to a file.
Serialization is a simple, but very useful technique that we'll cover here.
Chapter 12 deals with some of the more important topics in object-orientation,
namely inheritance and polymorphism. Modeling is important here. Readers will
learn the difference between association and generalization. It's important to
thoroughly understand the conceptual apparatus to program inheritance correctly.
With a solid foundation in object-oriented programming, readers should now
be in a position to understand the event model used to program graphical user
interfaces in Java. Chapters 13–15 cover this topic. The most common graphical
components are covered and emphasis is placed on distinguishing the classes that
describe the problem to be solved from the classes that describe the user interface.
Readers will create both applets and applications.

Introduction to advanced topics


Chapter 16 covers thread programming. Threads make it possible to multitask
internally within a single program. The Java interpreter makes extensive internal
use of threads—for example, in conjunction with graphical user interfaces.
Chapter 17 shows how the Java API can be used to create and handle the
traditional data structures—linked lists, queues, stacks, trees, and hashtables.
Recursion is also covered in this context.
Chapter 18 covers applets in a larger context. We look at the purpose for applets
and security in connection with them. The chapter also goes through
communication between applets and the browser.
Chapter 19 deals with programming distributed systems. There's a brief
introduction to socket programming, but the primary topic of the chapter is RMI.
We will create relatively complex distributed systems with callbacks.
The topic of chapter 20 is programming with databases. The chapter shows how
to use JDBC to get a Java program to communicate with a relational database using
SQL statements.
Chapter 21 is an introduction to server programming for the Internet. We'll see
how to use JSP to create systems for the Internet where users see customized Web
pages and where communication with databases is central.
We would like to thank...
Many people have made the work on this book possible: first and foremost, TISIP,
whose economic support has made it possible to carry out this project. We'd also
like to thank the Norwegian Technical Literary Fund [Det Faglitteraere Fond] for its
financial support.
A number of people have contributed opinions, ideas, and materials for the
book. We would especially like to express our gratitude to the following: Assistent
Professor Mildrid Ljosland and Associate Professor Tore Berg Hansen read carefully
through the entire manuscript and contributed extremely useful technical
Preface

comments. Engineer Simon Thoresen wrote answers for well over 30 programming
problems. The solutions for many of the most complicated problems present
material that supplements the contents of the book.
We would especially like to thank the three lecturers who dared to believe that
this would become instructional material that they could use during the 1999/2000
school year: Assistent Professor Bjorn Klefstad, Associate Professor Jan H. Nilsen,
and Lecturer Grethe Sandstrak. Along with approximately 100 students, they
worked with preliminary and unfinished course materials—their experiences were
very helpful to us.
The chapter on JavaServer Pages is not a part of the Norwegian edition, and
Assistant Professor Tomas Holt has contributed to this chapter with tips and
comments in an indispensable way.
Translator Tara F. Chace did an excellent job in translating all the text from
Norwegian into English during a very short period. Thanks to her!

Else Lervik

and

Vegard B. Havdal
reduction

Learning goals for this chapter


After reading this chapter, you should understand:

• The relationship between Java and the Internet

• The concept of a computer program

• The basics of compilation

After reading this chapter you should be able to:

• Compile and run a small program you have entered into the computer

The sun was probably shining in San Francisco on the 23rd of May 1995, when the
head of research at Sun Microsystems, John Gage, and perhaps the Internet1
world's biggest celebrity, Netscape founder Marc Andreessen, officially presented
the programming language Java and associated technology.
It was no wonder that Gage was one of the two men on the stage, as the language
in question first saw the light of day during a research project at Sun named Green.
Andreessen had been part of the small group of students who made the first
graphical browser for the WWW (Web), Mosaic. This program, and its successor
Netscape, had revolutionized the computing world during the early 1990s. The
new cooperation between Netscape and Sun would let small programs written in
Java make Web pages interactive and more alive. These plans received a lot of
attention, and there were plenty of ideas about programming toasters over the
Web, and more.
Even today, Java is strongly associated with the Internet, and many people think
the language is exclusively for use on the Web. This is absolutely wrong. Java is a
complete programming language, with its own distinctive features, and more and
less typical fields of use.

1. If these words are new to you, there is a glossary of terms in section 1.8 of this chapter.
1 Introduction

Java is a young programming language. Six or seven years is not long. As a result,
computing professionals or students need to keep up with the continuing
evolution of Java and its associated programs. Writing computer programs in a
language that's undergoing constant refinement may seem like an impossible task,
but in the case of Java, it is not. This is thanks to the language's design and
philosophy. In this book, we hope to give you a basis for understanding this.

1.1 Preliminaries for Reading This Book


Everyone starts their computing career as the user of one or more available
program(s). The term end user is also common. For instance, you might be using a
word processing program to write letters or school reports, or an invoicing program
at the store where you work. In addition, you are also a user of the computer's
operating system. The operating system keeps track of the programs we are
running, and lets us use hard disks, floppy drives and the rest of the hardware.
In this book, you will learn how such programs are created. What is taken for
granted is that you have been using a PC for a while. You should be familiar with
the terms file, directory and sub-directory. This means that when you are clicking
your way through the Windows Explorer, you know that you're dealing with a
structure of files in directories on a hard disk.
Programs in Windows are files with the suffix exe. If you double-click on one of
these files, you start that program. We call them program files. If you double-click a
doc file, the program Word will usually start. Try these things in Explorer yourself,
if you wish.2 It is important to note that this does not mean that the doc file is a
program. It is just how Windows keeps track of the fact that these files are meant
for the program Word, which must be started first. A doc file is data for the program
Word.
There is also an important distinction between text-based and graphical
programs. The vast majority of Windows programs have a graphical user interface.
The user interface is how we communicate with the computer. This might be done
using written commands entered on the keyboard, or we may point and click on
menus and buttons using a mouse. Occasionally in Windows we use the former, a
textual user interface. Then the textual dialogue takes place at the MS-DOS prompt,
or the console as we call it in this book. In Windows NT there is no MS DOS. There
it is called a command prompt. It is nevertheless depicted with an MS DOS symbol,
because MS DOS programs can be run. In the MS DOS console we navigate through
the directories with the command cd, change directory. When we feel like it, we can
run a program that is located in our current directory by typing its name. Some
people are familiar with using a computer this way, whereas many are not. Because

2. Keep in mind that Windows Explorer is often configured to hide the suffix of registered file types,
displaying a graphical icon instead. You can check this by looking at View, Options: Hide extensions
for known file types. We recommend not hiding the file extensions, to give you better control and
avoid confusion when several files have the same prefix.
1.2 Contemplating a Computer

we will start working with Java through a console window, you will have to learn
basic textual navigation. We will try to make this easy as we go along. If you need
to read more about this, do a Web search for "MS-DOS commands" or an
equivalent phrase. Or look at the book's Web pages on http://www.tisip.no/Java-
ThellmlWay/, where we have links to some primers.
When it comes to the physical construction of the computer, we have already
mentioned that there is usually a hard disk inside where files are arranged in
directories. Furthermore, it is good to know that there is a central "brain" called the
microprocessor and that the computer has internal memory that is often called RAM,
Random Access Memory. Another name for the microprocessor is CPU, Central
Processing Unit. It would be hard to avoid these terms in a book on programming.
The hard disk is an example of secondary memory. Even if we turn the computer
off, our data and programs will still be intact on the hard disk. All the contents of
the aforementioned internal memory disappear when the power is turned off. The
internal memory is used by the microprocessor to store the running programs, and
their data.
We have published additional information and numbered examples on the
Web. Hence we are assuming that the reader is familiar with using the Internet, at
least browsing a page on the Web and changing the basic configuration of the Web
browser. Try to go to http://www. tisip. no/JavaTheUmlWay/ and see if you can find
your way around.

1.2 Contemplating a Computer


It's no easy task to describe the workings of a computer to a beginner. When you
click on Windows Explorer there are several things taking place between you and
the chip on the motherboard inside the computer, the microprocessor. Dividing
the computer system into layers, see Figure 1.1, can help us see the bigger picture
here. Each layer is one or more running program (processes is more widely used in
this context), which makes up part of the operating system.
You start in the center, where there's a small program known as the kernel. This
program uses a small number of commands to perform operations in the hardware
of the computer. This is where it all starts.
Outside the kernel is the next layer, for instance the MS DOS text-based console.
Here the user can work with the computer using a number of textual commands
and run different programs. For each thing the user does in the console, several
operations will be executed in the kernel.
Outside the textual console interface, we usually find a graphical user interface.
This is familiar to most; using a mouse or another mechanical device we operate
the computer by pointing and clicking to start programs, move files, etc.
In Figure 1.1, we put a computer in the center to symbolize computer hardware
like disk drives, memory, screen and keyboard. The operating system kernel hides
this hardware so that the outside layers don't have to know details about the
hardware covered by the kernel. Outside the kernel, we can see a textual console
Other documents randomly have
different content
4,000 years ago? How again are we to account for the fulfilment of
the prophetic Word? How do we explain the fact that, in exact
accord with the prophecy, Canaan is the servant of servants; that it
was from Shem that the Lord appeared; that Japheth is at this day
remarkable for enlargement; and that we ourselves at this very
moment are assembled to worship in the house of the God of
Shem? It is impossible to believe that the book of Genesis was
written to suit the conclusions of modern science; for these
conclusions were utterly unknown at the time of its composition. It
is impossible to believe that it is the result of design in our scientific
men, for such an idea would indeed dishonour science. It is equally
impossible to believe that the agreement was the result of chance or
accident; for there are far too many points, both in the history and
prophecy, to render such accidental coincidence possible. It is like a
complicated lock which can only be opened by the key that was
made to fit it. No; there is only one solution of the problem. As for
the history, science agrees with it, and therefore confirms its truth;
and as for the prophecy, it could have had its origin in no human
calculation of the future; for how should Noah make any calculation
respecting the state of this nineteenth century? But all is plain if we
believe it to be inspired. He who inspired the prophecy, He saw the
end from the beginning. He knew all, and by the lips of Noah he
foretold what he foreknew; and thus we are brought to the
conclusion, so plainly stated by St. Peter—“The prophecy came not
in old time by the will of man; but holy men of God spake as they
were moved by the Holy Ghost.”
THE JEWS.

I am about, if God permit, to speak now of, by far, the most


remarkable people in the world. In the last chapter we studied the
Races, and found that through the labours of scientific men the
three patriarchs of 4,000 years ago reappear in this nineteenth
century as most important “witnesses to truth.” We put, as it were,
Shem, Ham, and Japheth into the witness-box, and the result of
their testimony was that Noah was inspired, and the Bible true.
Such a subject as that has a tendency to lose power through the
vastness of its extent. Our reading is not sufficiently wide, nor our
minds sufficiently large, to enable us to take in the whole. We are
dependent, moreover, on scientific men; and it is a strange thing,
but a fact, that those who talk most of science are generally the
least disposed to receive the conclusions of scientific men, when
those conclusions differ from their own. But now I am about to call
witnesses, in the examination of whom we do not want the help of
science; for in their case there are no scientific difficulties. Their
evidence is within reach of us all, and if we choose we may test it
for ourselves. I am not about to speak of what happened 4,000
years ago; but of what is going on now, of what took place last year,
and what any one may see for himself, if he will take the trouble to
go to Houndsditch or Petticoat Lane. There he will find a most
remarkable people, eager, quick, and intelligent, exceedingly
different from the rest of the inhabitants of London, and separated
from their fellow-townsmen by a social barrier, which is very seldom
overstepped. These remarkable people are the Jews.
Now there are five undoubted and indisputable facts respecting the
Jews that I propose, if God permit, to bring before you, and may He
be pleased to help our study to the confirmation of our faith, and to
the increase of our interest in His own ancient people!
(1.) Their Expatriation, or their expulsion as a nation from their
country.
Now it is a curious fact, that there is no other nation in the world
which has such a right to its own country as the Jews. Other
nations claim their country simply through the right of occupation.
We live in England, and our fathers lived there before us, so we
consider it ours, and are ready to lay down our lives for its safety.
But we have no title-deeds, and we have no documents to prove
that it is ours. But it is very different with the Jews. They have the
clearest possible documentary evidence of their covenant right to
Palestine. There is not a person in any town who has a better title
to his house than the Jews have to their country. It was distinctly
given to them by God Himself, as we read in Gen. xv. 18. And yet
after having occupied it for fifteen centuries, and after having shown
the utmost courage and determination in its defence, they were
driven from their homes by their Roman conquerors. Their city was
sacked, their temple burnt with fire, their country laid desolate, and
they themselves scattered homeless through the world. The result is
that at this present time there are many more Jews in London than
there are in the whole of Palestine. Now these are plain, well-known
facts, and facts so well established that they are beyond the reach of
contradiction.
(2.) Dispersion. When their home was broken up in Jerusalem they
were not carried elsewhere as they were when they entered it, like a
hive of bees moved from one garden to another, but they were
dispersed in all directions. From that day they have had no resting-
place anywhere, and they have never since had what we may term a
central home. They have had no head-quarters, and, although they
cluster more thickly in some places than in others, they have on the
whole gone forth as lone wanderers on the face of the earth. The
result is that, go where you will, you are sure to meet with Jews.
They are sometimes driven about by persecution, and sometimes
attracted by trade; but we need not study the cause of their
movements. They are found in all the continents—Europe, Asia,
Africa, America, and Australia; in new settlements and old countries,
in all climates and amongst all races; and as the seed is scattered
over the field, so the Jewish people are dispersed through the world.
(3.) Distinction, or Distinctiveness.
It appears to be the general law of human nature, that when
different races live together they become, before long, fused with
each other. There may be exceptions, as there are in certain cases;
but there is always some cause to account for it. In India, for
example, there is very little fusion between the English and the
Hindoo; but then it must be remembered that no English ever settle
in India as their permanent home. So in America there is not much
fusion between the European races and the negroes; but there again
we must remember that there is the almost impassable barrier of
the difference of colour as well as the slave curse on Canaan. But in
ordinary cases there is always fusion, and when there is no such
barrier the races soon amalgamate. In our own country, for
example, there are Britons, Romans, Saxons, Danes, and Normans;
but who can distinguish them? We are all merged into one race,
and the distinction of our nationality is totally lost. Who could pick
out from any congregation the Roman, the Dane, or the Norman?
But the Jew remains distinct. There is nothing to keep him separate,
but separate he remains. He is rich, and enterprising, and talented,
and often exceedingly handsome; but he does not amalgamate, and
he remains to this day as distinct from us all as he was when he first
landed on our shores.
(4.) Reproach and persecution.
Notwithstanding the wealth and great ability of the Jewish nation,
they have always been a people under reproach. In trade, if people
wish to describe any one as covetous, grasping, and avaricious, it is
not an uncommon thing for people to say that he is “a regular Jew,”
and thus, whatever a person may be in himself, the name “Jew” is a
term of opprobrium throughout the world.
But reproach is not all, nor nearly all; for they have had to endure
the most terrible persecutions. They have been treated most
barbarously by the nations amongst whom they have been
scattered. It has mattered little whether they have been living
amongst Pagans, Mahommedans, or spurious Christians, though I
fear it must be admitted that the treatment by spurious Christians
has been the worst. But I need not dwell on these horrible
atrocities; for they are fresh in our own memories. We have only to
go back to the newspapers of last year to learn what the poor Jews
endured in Southern Russia. Their property was plundered, their
homes burnt, their daughters—oh, I cannot tell you the horrors!—
and their whole families cast out on a pitiless world to perish from
cold, hunger, and nakedness; and all this in the face of the whole of
Europe in this enlightened nineteenth century.
(5.) Preservation.
But in the midst of all this they have been preserved. Kindness has
not fused them, reproach has not shamed them, and persecution
has not destroyed them; so that after eighteen centuries they are in
the midst of us still—still scattered through the world, still remaining
a separate people, still under reproach and persecution, but still
moving amongst us as an active, intelligent body of men; in the
midst of us, but not of us; living in England, but not Englishmen; the
subjects of another dynasty, the proprietors of another land, and the
scions of another home.
Now I wish to put it to all thinking and observing men, Can they
refer me to any other people in the world in which these five facts
are found to meet? Do they know of any other people that was ever
so completely removed from its home, that was ever so effectually
dispersed amongst the nations, that has been kept so distinct, that
has endured such reproach and persecution, and that,
notwithstanding all, has been so long preserved? There have been
amongst other races conquests, massacres, and migrations; but I
venture to affirm, without the slightest hesitation, that you may
search history from one end to the other, may ransack its pages for
all that you can find respecting the nations, and I venture to affirm,
without the slightest fear of contradiction, that you will not find one
in which any of those facts have taken place as they have with the
Jews, and still less one in whom in this most extraordinary manner
they have all been found to meet.
But now comes the question, How is all this to be explained? What
is it that has made the Jews such an exceptional people? What is it
that has made their experience so entirely different to that of all the
other peoples upon the earth? I ask the infidel to tell me if he can,
but I know he cannot; I ask the man of science to explain it on
scientific principles, but I know he cannot. But I ask the believer to
explain it, and he can do so in a moment by the simple answer, “It is
the hand of God.” But some man may say, “How do you know that it
is the hand of God? What proof have you that it is His doing?” A
perfectly clear proof that it is impossible to deny. There is a sixth
fact quite as plain as the other five; i.e., that all the five facts were
predicted in the prophecies, and that centuries before the dispersion
took place it was clearly foretold in the prophecies of the Word of
God. These facts were all foretold in prophecy, and therefore we are
firmly persuaded that they were all brought about by God. The
fulfilment of prophecy is a proof that the whole is of God.
In proof of this let us refer to a few passages.
I spoke of the fact of their expatriation, or expulsion from their own
land. Now what did Moses say of it fifteen hundred years before it
happened? Only mark his words: “Ye shall be plucked from off the
land whither thou goest to possess it.” (Deut. xxviii. 63.)
I spoke of their dispersion amongst the Gentiles. Now what did
Moses say of it? “Thou shalt be removed into all the kingdoms of
the earth.” (v. 25.) “And the Lord shall scatter thee among all
people, from the one end of the earth even unto the other; and
there thou shalt serve other gods, which neither thou nor thy fathers
have known, even wood and stone.” (v. 64.)
I spoke of their distinctness. Now what did Balaam say of it? “The
people shall dwell alone, and shall not be reckoned amongst the
nations.” (Num. xxiii 9.) And though these words were spoken no
less than three thousand three hundred years ago, do they not
predict exactly that which you may see this very day in London,
Liverpool and in every other great city of Europe?
I spoke of reproach and persecution. And returning to Deut. xxviii.,
what do we there find? In verse 33 you find the prediction of
persecution and spoliation. “The fruit of thy land, and all thy
labours, shall a nation which thou knowest not eat up; and thou
shalt be only oppressed and crushed alway.” And in verse 37 the
reproach in foretold: “And thou shalt become an astonishment, a
proverb, and a byeword, among all nations whither the Lord shall
lead thee.”
The last fact of which I spoke was the preservation, the long
preservation, through those eighteen centuries of unequalled trial;
and again we turn to Moses, and find him saying, “And yet for all
that, when they be in the land of their enemies, I will not cast them
away, neither will I abhor them, to destroy them utterly, and to
break my covenant with them: for I am the Lord their God.” (Lev.
xxvi. 44.)
Now all these passages are taken from the Pentateuch, the earliest
book of the Scriptures; and I have referred especially to them
because some people appear to speak with disrespect of the
Pentateuch. But here we see the Pentateuch prophecies fulfilled in
this nineteenth century in so remarkable a manner that no observant
man can deny it.
But if people prefer prophecies of a later date they shall have them;
for time makes no difference to truth, and the inspiration of the
Scriptures extends through its whole length.
We find that they have been driven from their country, and can no
longer inhabit the land which is their own. Now what did the
prophet Isaiah say? “Then said I, Lord, how long? And He
answered, Until the cities be wasted without inhabitant, and the
houses without man, and the land be utterly desolate, and the Lord
have removed men far away, and there be a great forsaking in the
midst of the land.” (Chap. vi. 11, 12.)
We found that they are scattered amongst all the nations of the
world. Now what did God predict by the mouth of Ezekiel? “The
whole remnant of thee will I scatter into all the winds.” (Chap. v. 10.)
We found that, though scattered, they are preserved as a distinct
and separate people. Now what did God foretell by the prophet
Amos? “For, lo, I will command, and I will sift the house of Israel
among all nations, like as corn is sifted in a sieve, yet shall not the
least grain fall upon the earth.” (See ix. 9.)
We found that in their dispersion they have been the object of cruel
reproach, and have endured much fierce persecution. Now what
said Jeremiah, the prophet of God, in chap. xxix. 18? “And I will
deliver them to be removed to all the kingdoms of the earth, to be a
curse, and an astonishment, and an hissing, and a reproach, among
all the nations whither I have driven them.”
But we found also that, notwithstanding all, they have been
preserved in a most marvellous manner; so that at the end of
eighteen centuries they are still amongst us a separate people, and
preserved in the providence of God. And is it not all explained by
that wonderful prophecy of Jeremiah? “If those ordinances depart
from before me, saith the Lord, then the seed of Israel also shall
cease from being a nation before me for ever.” (Chap. xxxi. 36.)
Such passages might be multiplied to almost any extent, as they
abound throughout the prophecies; and I have merely selected a
text from the Pentateuch and another from the later prophets to
illustrate each of the five facts to which we all are witnesses. And
are they not sufficient? How was it, I ask, that these great
prophecies were given, some fifteen hundred years, and some five
hundred years, before the dispersion? Was it accident? Was it
calculation or guesswork? How should the writers have calculated,
or, how should they have guessed? One thing is perfectly plain.
They could not have been written after the event; for ever since that
time the Jews have been dispersed over the world, and in all their
dispersions have carried with them these prophecies. If they were
forged afterwards, how did the forger get them into circulation
amongst all the scattered Jews throughout the world, and that
before there was a printing-press? They must have been written
before the event; and before the dispersion what human mind could
calculate the condition of the Jews after eighteen centuries of
wandering? Think calmly over it. Consider well the five facts; test
them both by history and the statements of modern travellers; and I
cannot doubt for one moment that the conclusion of any thinking
and intelligent man must be that the history of the Jewish people
has been ordained of God, and that the Scriptures foretelling it were
inspired by His Spirit, I cannot imagine how it is possible to avoid the
conclusion that it is His hand which has ordered all in His sovereign
providence, and His Spirit which has so clearly and so unmistakably
foretold it all in His Word. While, therefore, we grieve over the Jew,
and long to see, not only the nation safe in Palestine, but the
individual safe in his own Messiah, we consider it no small gift in
these sceptical days that we have him living amongst us as one of a
separate people, and so bearing an unconscious testimony to the
truth and inspiration of the prophecies of God.
But I cannot stop there; for it is not the inspiration of the Scriptures
only to which the Jews bear unconscious testimony, for they are
witnesses also to the faithfulness of God. Here they are after
eighteen centuries of dispersion, during which they have lived
without a king, and without a prince, and without a sacrifice; during
which they have been exposed to isolation, to temptation, to
reproach, to spoliation, and to most unjust persecution; but not one
grain has been lost from the seed, and here they are, Jews still.
Aye, and what is more wonderful than anything, they are thus
preserved in mercy, notwithstanding all that they have done, even in
the rejection of their own Messiah. How could it be, and how can
such preserving mercy be explained? Just turn to one text out of
many that may unlock the mystery. It is written, in Psalm cv. 42,
“He remembered His holy promise, and Abraham His servant.”
There was His own covenant given to Abraham, and our heavenly
Father is faithful to it still. Three thousand eight hundred years have
not exhausted His faithfulness, and even the sin of the Jew has not
prevailed over the fidelity of our God to His friend. Oh, what a
lesson does this teach us as to the faithfulness of our God! Will He
break the covenant which He has made with us in Christ Jesus? Will
He depart from the promise which He has ratified in the precious
blood of the chosen Messiah? Is not the covenant with Christ as
sure as that with Abraham? And though we may be deeply
conscious how unable we are to stand, and still more deeply
conscious how unworthy we are to be preserved, may we not rest in
the peaceful assurance of His covenant grace, and apply to all His
people in Christ Jesus these wonderful words in Jeremiah xxxi. 37:
“Thus saith the Lord; If heaven above can be measured, and the
foundations of the earth searched out beneath, I will also cast off all
the seed of Israel for all that they have done, saith the Lord”?
PALESTINE.

Can stones speak? Can rocks make their voice to be heard? The
Lord said of His people on His entrance into Jerusalem, “If these
should hold their peace the stones would immediately cry out.” And
this is very much what those very stones are now doing; for the
stones of Palestine are beginning to speak with a voice so clear and
decisive that it seems a perfect marvel that any thinking man should
be able to resist their evidence. Now therefore, if God permit, we
will study their testimony; we will put the rocks into the witness-box,
and endeavour calmly to learn from them what they teach us of the
truth of God. There are three subjects on which their evidence is
conclusive—the geographical accuracy, the historical truth, and the
prophetic inspiration of the Scriptures. Let us examine them on all
three points, and may that divine Spirit who inspired the word of His
own great grace bring it home to our understandings and our
hearts!

I. The Geographical Accuracy.


We must remember that a large portion of the Old Testament
consists in the history of that chosen line which connected the Lord
Jesus Christ with Abraham, and that the country which we generally
call “Palestine” was given to that family as their home. It was in
that country that Abraham sojourned, and that his family lived for
the 1,400 years between the Exodus and the Advent. It is obvious
therefore that the history of that family during all those centuries
must abound in allusions to the different places in that country, and
as the history enters very much into social life, we must naturally
expect very frequent allusions to the places in which the people
lived.
It is important for us also to remember that the history was not one
book written by one author at one time, but that much of it was
evidently contemporary history; so that there were different books
written by different authors at different times, beginning with Moses
3,300 years ago, and ending, as some suppose, with Ezra, or
Nehemiah, about 2,300 years ago.
Now the question is, “Do the various allusions to places which lie
scattered up and down the history agree or disagree with what we
know of those places from observation on the spot?” Through the
patient labours of some eminently scientific men working for the
Palestine Exploration Fund, we know a vast deal more of the country
than has ever been known since the dispersion of the people. We
have before us the result of a most careful scientific survey, from
which we may learn in perfect confidence the evidence of the rocks.
What we have to do therefore is to lay side by side the evidence of
the rocks and the evidence of the Books—to compare the two
carefully, and to ascertain whether or not the “witnesses” agree.
The ancient rule was, that “out of the mouth of two witnesses shall
every word be established.” Here then there are two witnesses—the
rocks and the Books—do they or do they not agree?
Let us begin with the Book of Joshua, a book recording the original
invasion of the country, and the distribution of the land among the
tribes. In the ten chapters, beginning with the 13th, we have a full
account of that distribution, and a clear definition of the boundaries
of eleven tribes, with a list of forty-eight cities assigned to the sons
of Levi. This list and these boundaries have been most carefully
examined by the officers of the Palestine Exploration Fund, and the
remarkable result is that they can trace almost every place
mentioned in Joshua; and what is more remarkable still, “there is
scarcely a village which does not retain for its desolate heap or its
modern hovels the Arabic equivalent for the name written down by
Joshua 3,300 years ago.” In many cases there is nothing more than
a cluster of a few wretched Arab huts, or a heap of shapeless ruins;
but so complete has been the identification that there is no doubt
left respecting Joshua’s boundaries; and if the Jews were to return
to-morrow, and in returning were to observe the distinction of the
tribes, those officers could at once point out to them their several
homes, and show them exactly what portion of the country was
originally assigned to them by lot.
This general fact is quite sufficient to prove the general accuracy of
the geography of the Book. But the general fact does not stand
alone, and there are countless details which are almost more
conclusive than the close agreement which we find existing between
the list by Joshua and that by scientific men. Let us consider one of
these details, and examine one neighbourhood in the light of
modern science. The neighbourhood shall be that of Bethel and
Hai. Respecting Bethel, no one, I believe entertains a doubt. It was
named by Jacob “Bethel,” or the house of God. It was afterwards
called “Bethaven,” or “the house of vanity,” in consequence of the
idolatry of Jeroboam; and the extensive ruins now found there are
called Beitin. Now Bethel does not stand alone, for it is frequently
connected with Hai; so that Abraham’s second halting-place, as
recorded in Gen. xii. 8, was on a mountain “having Bethel on the
west, and Hai on the east.” There were two ranges of hills running
from north to south, with a valley between them, and on a hill
standing in that valley Abraham pitched his tent, and built an altar
unto the Lord. Now, as I have just said, there is not the slightest
doubt about the identification of Bethel. But what are we to say of
Hai? In Joshua viii. we have an accurate description of its capture,
and every detail of the attack can be verified on the spot. But we
cannot find the name. There is a heap, or mound, on the slope of
the hill, which no doubt marks the site. But the name Hai is
completely lost. The name given to the mound is Tell. Now Tell is
the word for heap, so that Tell Ashtereh is the heap of Ashtaroth,
and Tell Kedes the heap of Kadesh. But to this heap there is no such
name attached, and the only name is Tell. “Tell” alone marks the
spot. And now turn to Joshua viii. 28: “And Joshua burnt Hai, and
made it an heap” (i.e. a Tell) “for ever, even a desolation unto this
day.” The name given by the modern Bedouin is exactly that of the
ancient record, and the testimony of the stones is in perfect
agreement with the scriptural narrative.
But this is not all. I have already pointed out that the hill between
Bethel and Hai was Abraham’s second halting-place; and if we turn
to Gen. xiii. we shall find, in verses 3, 4, that after he had been
down into Egypt he returned to that same spot, and there once
more he called on the name of the Lord. It was there that he made
Lot the generous offer of the choice of the land, and that “Lot lifted
up his eyes and beheld all the plain of Jordan.” But at first sight this
seems impossible, for between Bethel and Jordan there is a lofty
range of hills running from north to south, and completely
obstructing the view; and so the merely superficial observer might
say that the Book was wrong. But before we come to any such
decision we must consult the stones. And what will they say to us?
Go up the heights above Bethel on the west, and they will tell you
that there is no view of the plain of Sodom there. Go up on the
eastern side to the Tell that once was Hai, and there is no view
there. But now go to the mountain having Bethel on the west and
Hai on the east, the very spot where, according to the 13th chapter
of Genesis, Abraham and Lot were standing; and there through a
gap in the hills you see the very sight that tempted Lot, and you
look on the plains of Sodom, as Lot looked on them not much less
than 4,000 years ago.
And what makes the agreement still more wonderful is that the Book
was written by one who was not an inhabitant of the country, and
who had never stood on that mountain-top. It is obvious from the
history that Moses was never there, and accordingly it is obvious
from the Book that it was written on the eastern side of Jordan. In
all the Books written in Palestine the expression “Beyond Jordan” is
employed to describe the eastern side. But it is not so with the Book
of Genesis. In chapter l. 10 there is the mention of the “threshing-
floor of Atad,” where Joseph and his company made a mourning for
Jacob, and in verse 11 this place is said to be “beyond Jordan.” But
Atad was on the west side of Jordan, for it was amongst the
Canaanites, and is believed by learned men to have been between
the Jordan and Jericho. To Moses, therefore, approaching Canaan
from the east, it was “beyond Jordan.” To any pretender writing
after the occupation of the promised land it would have been “on
this side Jordan.” But to Moses, who died on the eastern side, and
never set his foot on the western side, it was “beyond.” He may
have seen it from Pisgah, but that was all. He never set his foot
there, for he never crossed the Jordan. So he never set his foot on
the mount between Bethel and Ai; but he wrote with the most
minute geographical accuracy. And thus we have the testimony of
the stones that the Book of Genesis was not only the Book of truth,
but, may we not add, that Moses was inspired by God Himself to
write with such perfect truthfulness of places which he had never
seen?
This one instance must suffice as an illustration of geographical
accuracy, and we may hasten to consider the second point; viz.:—

II. Historical Truth.


To this I turn with deeper interest, because it has been denied.
Voltaire, for example, describes Palestine as one of the worst
countries of Asia, comparing it to Switzerland, and says it can only
be esteemed fertile “when compared with the desert.” (Keith, p.
106.) There cannot be one moment’s doubt that in such statements
he exceeded fact. But others have pointed to the desolate hillsides,
and asked the question whether such a country could ever have
supported a population as dense as that of Norfolk or Suffolk. Now
let there be no mistake on this subject; for we are fully prepared
most freely to admit that the hill country, as we now see it, could not
possibly support a large population, and that there is a dreary,
barren desolation about it which is wholly unlike the descriptions of
rich fertility which abound through the Scriptures. One of these
descriptions will be sufficient; viz., Deut. viii. 7–9: “For the Lord thy
God bringeth thee into a good land, a land of brooks of water, of
fountains and depths that spring out of valleys and hills; a land of
wheat, and barley, and vines, and fig trees, and pomegranates; a
land of oil olive, and honey; a land wherein thou shalt eat bread
without scarceness, thou shalt not lack anything in it; a land whose
stones are iron, and out of whose hills thou mayest dig brass.” Now
I am not in the least afraid of saying plainly that such a description
as that is not true of modern Palestine. It is not a good land flowing
with milk and honey; it is not a land of vines and oil olives; it is not a
land from which a large population could eat bread without
scarceness. I read that there is not a vine to be seen between
Eschol and Beersheba, and that there are very few olives to be
found anywhere. What then are we to say? Was the historical
description true, or was it not? Were the people deceived, or was
God true to His Word? “Let God be true, but every man a liar.” On
this point let us ask the stones, and let us take the testimony of the
rocks. But in doing this we must not be content with taking a
tourist’s ticket, and hurrying as fast as possible along the beaten
tracks; but we must accompany our scientific men in their
investigations; and if we do so, what shall we find? In the first place
we shall find scattered through the country the ruins of an enormous
number of villages. The Exploration Fund have actually entered on
their map no less than 2,770 names. It is perfectly clear therefore
that there was once a very large and densely-packed population.
Then in the next place the careful observer will perceive that those
hills which are now so barren were once covered with terraces so as
to preserve the soil. Dr. Keith says that on one hill he counted no
less than sixty-seven such terraces one above another. Then if you
examine these terraces you find a countless number of cisterns and
water-courses cut in the rocks, proving clearly that there was once a
careful system of irrigation; and then, in conclusion, near many of
the villages there is found an olive-press, apparently used by the
whole village, while up amongst the terraces there are multitudes of
smaller wine-presses, apparently cut in the rocks by each proprietor
for his own use. In confirmation of this evidence I have been
informed by one for many years a resident in Jerusalem, that the
inhabitants are dependent for firewood on the roots of the vines and
the olives still found on the desolate hillsides. The roots remain,
though the trees are gone, and those roots unite in their testimony
with the rocks amongst which they are found. The evidence
therefore of the rocks is irresistible. The people are scattered
through the nations, and the rain has washed down the toil from the
broken terraces; but the rocks remain; and the proof is as clear as
any proof can be of anything, that there was once a teeming
population and a high state of cultivation, that the country was once
a land of vines and oil olives, and that it was a land maintaining a
prosperous, thriving, and painstaking people. Thus the rocks agree
with the Book. Those barren hills themselves supply the evidence of
their former fertility, and the stones cry out that the grand old
Pentateuch is historically true.

III. Prophetic Inspiration.


But we have not yet done with those barren hills; for we have not
yet exhausted their evidence. Some may enquire how it is that a
country which was once so fertile is now become so desolate; and
the answer may be given that the villages have been burned, the
terraces neglected, the cisterns broken, and the water-courses
choked, which is all perfectly true. But that is not enough to satisfy
a real enquirer. “How was it,” the thoughtful man will ask, “that the
villages were burned and the terraces neglected?” In the answer of
this question the rocks can give us no assistance, and we must
depend entirely on the Book; but there we find the whole mystery
solved. The fact is, that the whole country bears witness to the
truth of prophecy. The present state of things is exactly what God
foretold in His Word. It is perfectly true that the mountains are
dreary, barren, and desolate; perfectly true that it is no longer “the
land flowing with milk and honey, the glory of all lands;” but it is
equally true that the change which has taken place is exactly that
which God foretold in the Scriptures.
What did Moses write three thousand three hundred years ago?
Turn to Leviticus xxvi. 33: “And I will scatter you among the
heathen, and will draw out a sword after you; and your land shall be
desolate, and your cities waste.”
What did Isaiah say, writing about two thousand five hundred years
ago? Turn to Isaiah vi. 11: “Then said I, Lord, how long? And He
answered, Until the cities be wasted without inhabitant, and the
houses without man, and the land be utterly desolate.” Turn to
chap. xxiv. 3: “The land shall be utterly emptied, and utterly spoiled;
for the Lord hath spoken this word.” Or to chap. xxxii. 12, 13: “They
shall lament for the teats, for the pleasant fields, for the fruitful
vine. Upon the land of my people shall come up thorns and briers;
yea, upon all the houses of joy in the joyous city.”
What did Jeremiah say, writing about two thousand three hundred
years ago? Turn to Jeremiah iv. 26, 27: “I beheld, and, lo, the
fruitful place was a wilderness, and all the cities thereof were broken
down at the presence of the Lord, and by His fierce anger. For thus
hath the Lord said, The whole land shall be desolate; yet will I not
make a full end.” “The spoilers are come upon all high places
through the wilderness: for the sword of the Lord shall devour from
the one end of the land even to the other end of the land: no flesh
shall have peace.” (Chap. xii. 12.)
And what did Ezekiel, writing about the same time, predict of the
condition of Palestine during the dispersion, and until the restoration
of the people? Turn to his address to those hills of which we have
been speaking, in Ezekiel xxxvi. 3, 4: “Therefore prophesy and say,
Thus saith the Lord God; Because they have made you desolate, and
swallowed you up on every side, that ye might be a possession unto
the residue of the heathen, and ye are taken up in the lips of talkers,
and are an infamy of the people: therefore, ye mountains of Israel,
hear the word of the Lord God; Thus saith the Lord God to the
mountains, and to the hills, to the rivers, and to the valleys, to the
desolate wastes, and to the cities that are forsaken, which became a
prey and derision to the residue of the heathen that are round
about.”
Here then we have the whole mystery solved, and the whole thing
explained. In His sure Word of prophecy our heavenly Father told us
what He would do, and the desolate hills of Palestine bear witness
that He has done it. We may long to see them clothed once more
with the vine and the olive, and we may profoundly pity their lawful
proprietors, who look on their lawful home—once so beautiful, but
now so desolate! But yet we cannot look even on that desolation
without thanksgiving, for it is an evidence to all thinking men of the
certain truth of God’s inspired Word. Those who refer to those
desolate hills as an argument against the truth forget that the
desolation to which they refer is a conclusive proof of the truth of
the prophetic Word of God. Thus we are carried by this third proof
far beyond either geographical accuracy or historical truth. A book
may be geographically accurate, or historically true, and yet not be
inspired. But no man can foretell the future. No man can look
forward 3,000 years. No man, therefore, could span over all those
centuries and tell us ages ago what would be the condition of
Palestine in this nineteenth century. But God has done it. We thank
God, therefore, for His Word, and we thank Him also for the
testimony of the rocks. Nay, more, we may thank Him even for the
sneers of such a man as Voltaire, for the very sneers are a proof to
the students of the Scriptures that God’s prophecy is being fulfilled,
and that God’s Holy Word may be trusted as divine.
But we must not leave the subject there, for we are taught a most
solemn lesson as to the desolating power of a righteous God. He
who has reduced those fertile hills to desolation, cannot He equally
desolate the soul, and reduce the poor ruined heart to a similar
condition of barren hopelessness? And will He not do it if His great
salvation be neglected? I know that it is the fashion to believe that
He is too merciful to punish; but for my own part I find it much more
easy to believe that he is too true to declare that which he has no
intention of performing. If the Word of God be true, “Verily there is
a God that judgeth the earth,” and we cannot doubt that to the
guilty sinner He must prove “a consuming fire.” But, thanks be to
His Holy Name, if the warnings be true, so also are the promises. If
the judgment be certain, so also is the salvation. If the minister of
wrath be sure to fulfil the Word of judgment, so also is the blessed
Saviour perfectly sure to fulfil the promises of life. If the law
condemn with infallible certainty, so also does the Gospel proclaim
that the claim of the law is satisfied in the great propitiation by the
Son of God; so that any one, even the least and most unworthy of
His people, may peacefully rest in the certainty of His never-failing
Word, and abide in perfect peace, and perfect safety, in the perfect
truth, and never-failing covenant of God.
SCOFFERS.

I propose to call the evidence of an unwilling witness, and to ask the


scoffer himself to bear his “testimony to the truth” against which he
scoffs. There is no better evidence than that which is given
unwillingly—than that of a man who is put into the witness-box in
order to prove one thing, and when closely examined is compelled
by the force of truth to prove the opposite. Now as a general rule
the scoffers desire to dishonour the Scriptures; they ridicule its
statements, and deny its inspiration. But I am not sure that, if
carefully examined, they will not be found to confirm the Word. Let
us then carefully study their evidence, and may God the Holy Ghost
bring it home to their hearts and our own!
But before we examine the modern scoffers, we must turn to what
the Word of God has said respecting them. Rather more than
eighteen hundred years ago the apostle Peter wrote two letters, the
first addressed to scattered strangers, and the second to those who
had “obtained like precious faith with us through the righteousness
of God and our Saviour Jesus Christ.” In this second Epistle he gave
a divine prophecy to all such persons, and told them from God what
they were to expect in the latter days. He taught them quite clearly
that when they were approaching the end they were not to expect
to be like some beautiful ship (with its sails set and its flags flying)
sailing gallantly into the harbour, with a bright sunshine, a flowing
tide, and a prosperous breeze; but rather like some weather-beaten
craft, battered by the storm, beating up against the gale, and almost
overwhelmed by the breakers on the bar. And it teaches also that
one of the trials of those last days will arise from scoffers. As in
navigation the chart may teach that there are dangerous rocks near
the harbour mouth, so the prophecy says that when we draw near to
the coming of the Lord, there will arise certain persons who will not
be afraid even to scoff at the revelation of God. Let us first examine
the prophecy, and then we shall be prepared to compare it with the
fact. It assures us then of the fact that there will be scoffers, and it
gives us a fourfold description of their character.
We shall find it in 2 Peter iii. 3–5: “Knowing this first, that there shall
come in the last days scoffers, walking after their own lusts, and
saying, Where is the promise of His coming? for since the fathers fell
asleep, all things continue as they were from the beginning of the
creation. For this they willingly are ignorant of, that by the word of
God the heavens were of old, and the earth standing out of the
water and in the water.”
(1.) They will scoff.
Now, as a general rule, a scoffer is not a reasoner. It requires some
knowledge and logical power to argue, but any fool can scoff. In
fact, it seems the peculiar attribute of folly; for we are distinctly told
that “fools make a mock of sin.” Now in this passage it is clearly
foretold that in the last days men will scoff. But when St. Peter
wrote the words he must have thought it almost impossible. For let
any man look around at the visible effects of sin—the ruin, the
misery, the wretched homes, the miserable wives, the pitiable
children, the sickness, poverty, crime, violence, and every species of
abomination resulting from sin—and can any wise man scoff at sin?
Or look at the majesty of God, at His omnipotence, His
omnipresence, His omniscience, His infinitude, His holiness, His sin-
abhorring character, and it seems impossible that there should be
anyone bold enough to presume to scoff at the Most High God.
Or look at His love in Christ Jesus; in the provision of such a
salvation for sinners such as we are; in providing such a Lamb for
the burnt-offering; in making to the guilty such an offer of such a
salvation on such terms of magnificent generosity, and can it be
possible that any man should scoff at that? Will they scoff at the
love that prompted it, at the sacrifice made for it, or at the pardon
and life presented through it? We might as well expect to see the
condemned criminal scoffing at a free pardon from the Queen.
But notwithstanding all that, the prophecy says plainly that in the
last days there shall be scoffers.
(2.) The next clause throws further light on their character; for it
teaches that they will walk after their own lusts. Now “lust” does
not mean merely the low, vicious, depraved passion of the
profligate; but the word in old English expresses exactly the
meaning of the Greek—the appetite or will of the natural man. A
person, therefore, may be what “the world” calls a moral man, and
still be walking after his own lust. Such characters are described by
the prophet Isaiah in the words, “We have turned every one to his
own way.” (Chap. liii. 6.) And again, chap. lxvi. 3, “Yea, they have
chosen their own ways.” They make of themselves their own god.
They set up their own understanding as their teacher, and their own
will as their law. Their religion consists in one letter of the alphabet,
that one most absorbing letter, “I.” “I know,” “I think” “I choose,” “I
will,” “I am,” and “I act as I think proper;” and thus it is that their
own will becomes their only god. Oh what a miserable god! Oh,
what a contrast to the life of him who knows his Saviour! to the
blessedness of the man whose life is hid with Christ in God, and
whose daily prayer is, “Thy will be done!” But though it seem almost
impossible, the words of the prophecy are perfectly clear that the
rise of such characters will be amongst the anxious trials of the latter
days.
(3.) But this is not all; for the next clause shows they will scoff at
the hope of the Advent, and they will say, “Where is the promise of
His coming? for since the fathers fell asleep all things continue as
they were from the beginning of the creation.” This does not mean,
“Where shall we find the promise in the Scriptures?” but rather,
“What has become of it? Everything is going on just as it always has
done, and He is not come yet. The winter comes and goes, the sun
rises and sets, the business of life goes on as in former days, and
the Lord has not yet appeared; so what are we to think of the
promise?” St. Peter points out the true answer to all this; viz., that
God’s time must not be measured by man’s scale; for that “one day
is with the Lord as a thousand years, and a thousand years as one
day,” and he might have added that prophecy of our Lord Himself, in
which he taught us that everything will go on exactly the same right
up to His return; viz., “For as in the days that were before the flood
they were eating and drinking, marrying and giving in marriage, until
the day that Noe entered into the ark, and knew not until the flood
came and took them all away; so shall also the coming of the Son of
man be.” (Matt. xxiv. 38, 39.) It is most important that we bear this
well in mind; for there is an undoubted tendency in us all to settle
down into an undefined feeling that things that have gone on
without a change will go on still without a change, and so to allow
our hope of the Advent to grow weary, or to burn itself out through
delay. There is this tendency in even the Christian mind, and in all
probability there are few amongst us who have not felt the need of
watching against the temptation. So in this prophecy the scoffer is
predicted as availing himself of this natural tendency in our hearts,
and turning it against the promises of God; as attacking the Christian
in His blessed hope; as striving to shake the faith of believers; and
as endeavouring to pull down those who are looking for the Lord to
the dreary level of utter hopelessness on which he finds that he
himself is standing. It seems a very cruel thing, and I often think
that if I were an infidel I could not endeavour to shake the faith of
other men. It seems a horrible thing, that because a man is without
hope himself, he should endeavour to take away hope from others;
and a most especially horrible thing that he should endeavour to
poison the minds of children, and so harden their young hearts
against the reception of the truth of God. But though it seem so
cruel, so unnatural, and so contrary to any principle of ordinary
benevolence, the prophecy teaches quite plainly that so it will be in
the “latter days.”
(4.) But there is one more feature in the description; viz., this, that
these scoffers are “willingly ignorant.” The ignorance here predicted
has special reference to the creation and the flood; but the point to
which I would draw your most especial attention is the willingness of
its character. Ignorance in many cases is the result of
circumstances, and in some of grave misfortune. There are some
who long for knowledge, but have no opportunity of obtaining it;
and there are many others who, though they show no such thirst,
cannot be blamed; for they have never known enough even to excite
an appetite. But the prophecy describes men who are determinately
and wilfully ignorant; who are ignorant, not because they cannot
know, but because they will not. They are like those persons
described in Romans i. 28: “Even as they did not like to retain God in
their knowledge.” Such are the people described in this prophecy—
persons who are profoundly ignorant of the whole purpose of God in
Christ Jesus; who know absolutely nothing of that knowledge of the
true God and of “Jesus Christ, whom He has sent,” which the Lord
Himself declared to be “life eternal;” and who do not wish to know
it, but had rather remain without the knowledge. The result is, that
they will read no Christian evidence, will care for no books but those
of infidels, and will never search their Bible, unless it be to find out
something which they may make the subject of their mockery. Such
is the willing ignorance most clearly predicted in this prophecy.
There are, therefore, four points clearly predicted in the character of
those persons who, according to prophecy, must be expected in the
“latter days.” They will scoff; they will walk after their own will; they
will call in question the Lord’s coming; and they will be willingly
ignorant of His inspired truth. What then should be the effect on our
own minds when we see the fulfilment of this prophecy? Should it
shake our faith, or strengthen it? Should it lead us to doubt our
Bibles, or to rest in them as the truth of God? When we found that
Noah’s great prophecy respecting Shem, Ham, and Japheth was
fulfilled, what was the effect? It assured us that the Pentateuch was
true, and the Bible inspired. When we found a whole series of
prophecies respecting the Jews and Palestine were literally fulfilled,
what again was the effect? It assured us that the Bible was true,
and those prophets inspired. So now, if we see with our own eyes
the clear fulfilment of St. Peter’s prophecy, what again must be our
conclusion? What but that the Bible is true, and that the apostle
Peter was inspired? Thus it is that the scoffer against the truth
becomes a witness for the truth, and the man who would insult our
God by what he calls “profane jokes” is unconsciously and
unintentionally bearing testimony to the God whom he insults. If
there were no such scoffers in these latter days, then indeed we
might begin to doubt the inspiration of the prophetic Word. If the
Jews had remained settled in their own country, and had never been
dispersed among the nations, then we might have doubted the
inspiration of the prophets respecting them; and so, if there were no
infidels and no scoffers, then we might call in question the
inspiration of the Scriptures that predicted them. But now, as the
Jews are witnesses to one class of prophecy, so are the scoffers to
another; and while we grieve for the poor men, and most heartily
desire to see them saved with the great salvation, we may be at the
same time thankful for their evidence, and may accept their scoffing
is an unanswerable testimony to the prophetic truth of the inspired
Scripture.
But that is not all. For when we have such a prophecy, so full in its
prediction, and so clearly proved by its fulfilment to have been
inspired by God, we are bound by every principle of allegiance to
Him to listen to His counsel and act on His warning. If we believe
His Word, the least we can do is to be on our guard; and if God has
predicted scoffers, we ought to be prepared to meet them. This is
the application which the apostle Peter makes of his own prophecy,
and the passage is a remarkable instance of the application of a
prophecy by the prophet who was employed to give it. Turn, then,
to verse 17 of the chapter, and there you find him saying, “Ye
therefore, beloved, seeing ye know these things before” (i.e., that
you are fully warned beforehand), “beware lest ye also, being led
away with the error of the wicked, fall from your own stedfastness.”
He points to a danger against which we should watch, and a
standard at which we are to aim. The danger is that, “being led
away with the error of the wicked,” we should “fall from our own
stedfastness.” The standard is, that we “grow in grace and in the
knowledge of our Lord and Saviour Jesus Christ.” But if we are to
act on this advice, it is clear that we must be armed in the
understanding. It is not enough that we feel emotion; but we want
to be able to give a reason for the hope that is in us—to know what
that hope is, and to know also the strong foundation on which it
rests. Most especially would I urge this on our young men. As you
go through life you are almost certain to meet with scoffers, and
when you do you do not want to be like them, willingly ignorant.
Our position is perfectly impregnable! We have a rock under our
feet which nothing can shake. We have facts which cannot be
disproved, and an accumulation of evidence which is not to be found
respecting any other book in the world. But we must not let our
weapons remain locked up like old armour in some baronial hall, but
we must have them out, and use them with vigour. They are made
of the best of steel; but we must take care that there is no rust on
the blade, and so be able to meet the scoffer; not by scoffing, but
by the sword of the Spirit, remembering well the assurance of
Scripture, that “the weapons of our warfare are not carnal, but
mighty through God to the pulling down of strongholds.”
But it is not in the understanding only that we require to be armed,
for I believe there is no armour like the heart’s experience of the
love of God in Christ Jesus. The happy, consistent, thankful believer,
he is not afraid of the scoffer. He knows whom he has believed, and
he is persuaded that he is able to keep that which he has committed
to Him against that day. He pities the scoffer, therefore; but he is
not afraid of him except for the harm that he may do to others. He
has felt the strength of the rock under his feet, and he is not going
to be driven from it on to the shifting sands of unsettled infidelity.
Oh, may God grant to every one of us strong assurance in the grace
wherein we stand! May He keep us in the hearty enjoyment of an
abiding union with Christ Jesus our Lord! that so, strong in the Lord,
and in the power of His might, we may stand fast in Him; redeemed
by His blood; born again by His Spirit; called by the Holy Ghost;
justified in His righteousness; forgiven through His atonement; and
made heirs according to the hope of eternal life! If that be granted,
we can afford to be scoffed at; and if that be ours, we should be
stirred in the very depths of our soul to fresh energy as the
witnesses for Christ. The scoffer himself is a witness to Him,
inasmuch as he is a living, speaking, visible proof of the fulfilment of
the prophetic Word. But it is not so that we must bear our
testimony. He is a witness to truth by his denial, we by our
confession; he by his insult, we by our reverend faith; he by denying
the coming of our Lord, we by expecting it; he by the assertion of
his own will, we by the surrender of ourselves to the will of the
Lord. So it is that we may realize the full meaning of the words of
our Lord, “Ye shall receive power after that the Holy Ghost is come
upon you, and ye shall be witnesses unto me.”
THE SACRAMENTS.

It was one of the principles of the ancient Jewish law, that “in the
mouth of two or three witnesses shall every word be established.” I
have already exceeded that requirement in having brought before
you no less than five “witnesses” to establish the truth and
inspiration of the Scriptures; but I propose, if God permit, to
conclude my series with two more:
They shall be very simple witnesses, and to the eye of man quite
insignificant. They shall not have in themselves any apparent power
of testimony; but yet I believe they are intended to speak in words
of irresistible argument to all thinking men, and I trust will carry
home to the hearts of those who are not “willingly ignorant” the
most conclusive evidence of the truth of God. I refer to the two
Sacraments of the Lord’s appointment—Baptism and the Lord’s
Supper. In 1 John v. there appears to be a distinct reference to the
Jewish rule, and there are three witnesses mentioned as bearing
testimony upon earth—“the Spirit, and the water, and the blood.”
The passage is not an easy one, and it behoves us to speak with
caution. But I cannot help believing that by “the Spirit” is meant the
testimony of the Holy Ghost in His inspired Word; and by “the water
and the blood,” the two Sacraments, Baptism and the Lord’s Supper.
It is to the testimony of these two latter witnesses that I now
propose to refer; but we must remember there is nothing in either of
them of a conspicuous or ostentatious character. In neither one nor
the other is there anything like a material monument, nor anything
to attract the attention of “the world;” there is no erection of granite
or marble, nor any inscription like those on the stones from Nineveh;
but they are both simple acts of the simplest possible character. A
little water is all that is visible in the one, and a little bread and wine
in the other; and yet, though so simple, so insignificant, and so
absolutely without any visible monument, for the last eighteen
hundred years they have been bearing their testimony as
“witnesses” for Christ. Let us then conclude our series by the
examination of their evidence, and let us consider two points: (1)
Their present position; and (2) When and how did they acquire it?
May God so bless our study by the Holy Ghost as to bring home
conviction to all our hearts and understandings.
(1.) Their present position.
In order to realise this we must not confine our thoughts to our own
personal enjoyment of our own sacred privileges. We may come to
the Lord’s table as individuals, and find in the sacred feast such “a
strengthening and refreshing of our souls” as may be to us the most
conclusive and satisfactory evidence of the certain reality of the
grace of God; but our personal experience would be no evidence to
others, and our own enjoyment would not be regarded by the
sceptic as a proof; it would be evidence to ourselves, but not to him,
nor to the world at large. We must therefore take a wider range,
and consider only such evidence as lies within the cognizance of all
observing men. For this reason I have selected their position in the
Church of Christ at this present time. I am not about to ask you to
consider past history, but present facts; facts that may be tested by
every one, facts belonging to this enlightened nineteenth century;
and what I ask you to do is quietly and patiently to investigate facts.
Taking then our standpoint in this year of our Lord, 1883, we find
that the Church of Christ has been extending for just 1850 years,
and that throughout that time it has been spread by countless
agents, and in countless manners, in every direction throughout the
world. Starting as it did from Palestine, it has now taken root on
every continent, and it has borne the sacred Name of our blessed
Saviour into every quarter of the globe.
But while there has been this world-wide spread of Christianity, and
while there is at this present time this widely-extended
acknowledgment of the Name of the Lord Jesus, it is at the same
time perfectly obvious that there are within the Church of the
baptized immense diversities both of creed and practice. There are
different Churches standing aloof from each other. There is the
Church of Rome in conflict with what is called the Greek Church on
the one hand, and with us Protestants on the other. What is
commonly called the Greek Church consists again of many branches,
or is rather an aggregate of many independent Churches not united
under any one head. There is the original Greek Church, the
Russian, the Syrian, the Coptic, and the Abyssinian. So in the
Church of Rome there are various orders, besides the great division
between the secular and regular clergy; while we all know, to our
heartfelt sorrow, how those who are united in their love for the great
Scriptural principles of Protestant truth are still divided into various
denominations. Thus, looking at the Church of Christ as a whole, we
find it spread into so many places that it encircles the world; and
broken up into so many sections that it is hard to trace what we may
term any visible corporate union. There is separation as to place,
and divergence as to Church organisation.
But now we come to the wonderful and indisputable fact that,
notwithstanding all this separation and all this divergence in all
countries and many systems, wherever we find the name of Christ
there we find His own two Sacraments; and wherever we meet with
Christianity there we are sure to meet with Baptism and the Holy
Communion, God’s two witnesses to His inspired truth.
This is sufficiently wonderful if you think merely of the geographical
extension of the Church. The visible Church is spread amongst
different nations, in different climates, and with different habits;
some of which are leading the way in civilization and science, while
some are sunk in barbarism; some leading the thoughts of the
world, and some apparently never thinking at all; some absorbed in
trade, and some so completely without trade that they have not
even a currency. In some there are old churches that have existed
for centuries, and in some churches of modern formation recently
called into being through colonization and missions; and yet, though
the two Sacraments are so perfectly simple that there is nothing in
themselves to spread or perpetuate themselves, wherever you go
you find them. Place and space have made no difference. Go to
Europe, Asia, Africa, or America, it makes no difference; wherever
you go there you find God’s two Sacraments essentially bound up
with the Christianity of the people.
But what is more wonderful still, the divergences in the faith have
not destroyed them. There are different Churches most earnestly
opposed to each other, as the Church of England to that of Rome,
and the Church of Rome to that of Constantinople; but all have the
two Sacraments. So at home there are various denominations, sadly
disunited, and in some cases, I fear I must say, opposed; but yet
amidst them all there remains this remarkable fact, that, with one or
two perfectly insignificant exceptions, they all observe these same
two Sacraments. And what makes this more remarkable still is the
fact that throughout Christendom there are immense diversities of
opinion on the particular subject of these Sacraments; and there is
scarcely any subject around which controversy has raged more
fiercely. Both Baptism and the Lord’s Supper have been the subject
of sharp contention; and they have both been misinterpreted,
misrepresented, and misused. Desperate heresies have been
attached to them both, and they have become the battle-field for
most determined theological conflict; but, notwithstanding all this
confusion of tongues, the great fact still remains, that after eighteen
centuries of conflict, here they are still. Controversy has not
destroyed them; perversion has not put an end to them; separation
has not divided them; but in the midst of all disturbing forces they
remain. Wherever you find Christianity, there you find them. In all
parts of the world, and in all Churches on the face of the earth, they
are inseparably connected with the confession of Christ; and, as a
matter of fact, there is not a Church in Christendom which in some
mode or other does not observe them both.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like