Bridge builders

A “Literary” Computer Programming Language

The epigraphs of the book “The Java Language Specification”
informatics, computing, programming language, Java, computer programming, Java programming language

Contents

1. Introduction
2. Grammar
3. Lexical Structure
3.12. Operators
4. Types, Values and Variables
4.5.5. Variables Have Types, Object Have Classes
5. Conversions and Promotions
5.5. Casting Conversion
5.6.2. Binary Numeric Promotion
6. Names
6.8.6. Local Variables and Parameter Names
7. Packages
7.3.12. Unique Package Names
8. Classes
8.3. Field Declarations
8.4. Method Declarations
8.6. Constructor Declarations
8.6.8. Preventing Instantiation of a Class
9. Interfaces
9.3. Field (Constant) Declarations
9.4.3. Examples of Abstract Method Declarations
10. Arrays
10.10. Array Store Exception
11. Exceptions
11.1. The Causes of Exceptions
11.5.2. The Class Error
12. Execution
12.9. Virtual Machine Exit
13. Binary Compatibility
13.5.5. Abstract Method Declarations
14. Blocks and Statements
14.1. Normal and Abrupt Completion of Statements
14.8.1. The if-then Statement
14.18. The try statement
14.18.1. Execution of try-catch
14.18.2. Execution of try-catch-finally
14.19. Unreachable Statements
15. Expressions
15.5. Normal and Abrupt Completion of Evaluation
15.6. Evaluation Order
15.6.3. Parentheses and Precedence Respected
15.11.2. Compile-Time Step 2: Determine Method Signature
15.14.2. Prefix Decrement Operator —
15.15. Cast Expressions
15.16.1. Multiplication Operator ·
15.16.2. Division Operator /
15.16.3. Remainder Operator %
15.18. Shift Operators
15.20.3. Reference Equality Operators == and !=
15.27. Constant Expression
16. Definite Assignment
16.2.13. try Statements
17. Threads and Locks
17.5. Rules about Locks
17.12. Threads
17.14. Wait Sets and Notification
18. Documentation Comments
20. The Package java.lang
20.2. The Interface java.lang.Cloneable
20.4. The Class java.lang.Boolean
20.5. The Class java.lang.Character
20.11. The Class java.lang.Math
20.15. The Class java.lang.Process
21. The Package java.util
21.2. TheClass java.util.BitSet
21.5. The Class java.util.Hashtable
21.9. The Class java.util.Random
21.12. The Class java.util.Stack

Title page

“‘When I use a word,’ Humpty Dumpty said, in rather a scornful tone, ‘it means just what I choose it to mean—neither more nor less.’

‘The question is,’ said Alice, ‘whether you can make words mean so many different things.’

‘The question is,’ said Humpty Dumpty, ‘which is to be master—that’s all.’”

Chapter 1 Introduction

“If I have seen further it is by standing upon the shoulders of Giants.”

Chapter 2 Grammar

“Grammar, which knows how to control even kings…”

Chapter 3 Lexical Structure

“Lexicographer: A writer of dictionaries, a harmless drudge.”

3.12. Operators

“Give her no token but stones; for she’s as hard as steel.”

“These lords are visited; you are not free;
For the Lord’s tokens on you do I see.”

“Thou, thou, Lysander, thou hast given her rhymes,
And interchanged love-tokens with my child.”

“Here is a letter from Queen Hecuba,
A token from her daughter …”

“Are there no other tokens…?”

Chapter 4 Types, Values and Variables

“I send no agent or medium,
offer no representative of value,
but offer the value itself.”

4.5.5. Variables Have Types, Object Have Classes

“Oft on the dappled turf at ease
I sit, and play with similes,
Loose types of things through all degrees.”

Chapter 5 Conversions and Promotions

“Thou art not for the fashion of these times,
Where none will sweat but for promotion.”

5.5. Casting Conversion

“Sing away sorrow, cast away care.”

5.6.2. Binary Numeric Promotion

“O suns! O grass of graves! O perpetual transfers and promotions!”

Chapter 6 Names

“The Tao that can be told is not the eternal Tao;
The name that can be named is not the eternal name.
The Nameless is the origin of Heaven and Earth;
The Named is the mother of all things.”

6.8.6. Local Variables and Parameter Names

“What’s in a name? That which we call a rose
By any other name would smell as sweet.”

“Rose is a rose is a rose is a rose.”

“…stat rosa pristina nomine, nomina nuda tenemus.”

Chapter 7 Packages

“Good things come in small packages.”

7.3.12. Unique Package Names

“Did I ever tell you that Mrs. McCave
Had twenty-three sons and she named them all ‘Dave’?
Well, she did. And that wasn’t a smart thing to do. …”

Chapter 8 Classes

class 1. The noun class derives from Medieval French and French classe from Latin classis, probably originally a summons, hence a summoned collection of persons, a group liable to be summoned: perhaps for callassis from calare, to call, hence to summon.”

8.3. Field Declarations

“Poetic fields encompass me around,
And still I seem to tread on classic ground.”

8.4. Method Declarations

“The diversity of physical arguments and opinions embraces all sorts of methods.”

8.6. Constructor Declarations

“The constructor of wharves, bridges, piers, bulk-heads, floats, stays against the sea …”

8.6.8. Preventing Instantiation of a Class

“Bow, bow, ye lower middle classes!
Bow, bow, ye tradesmen, bow, ye masses!
Blow the trumpets, bang the brasses!
Tantantara! Tzing! Boom!”

Chapter 9 Interfaces

“My apple trees will never get across
And eat the cones under his pines, I tell him.
He only says ‘Good Fences Make Good Neighbors.’ ”

9.3. Field (Constant) Declarations

“The materials of action are variable, but the use we make of them should be constant.”

9.4.3. Examples of Abstract Method Declarations

“Death, life, and sleep, reality and thought,
Assist me, God, their boundaries to know …”

Chapter 10 Arrays

“Even Solomon in all his glory was not arrayed like one of these.”

10.10. Array Store Exception

“At length burst in the argent revelry,
With plume, tiara, and all rich array …”

Chapter 11 Exceptions

“If anything can go wrong, it will.”

11.1. The Causes of Exceptions

“If we do not succeed, then we run the risk of failure.”

11.5.2. The Class Error

“No rule is so general, which admits not some exception.”

Chapter 12 Execution

“We must all hang together, or assuredly we shall all hang separately.”

12.9. Virtual Machine Exit

“… Farewell!
The day frowns more and more. Thou’rt like to have
A lullaby too rough: I never saw
The heavens so dim by day: A savage clamour!
Well may I get aboard! This is the chase.
I am gone for ever! [Exit, pursued by a bear]”

Chapter 13 Binary Compatibility

13.5.5. Abstract Method Declarations

“Lo! keen-eyed, towering Science! …
Yet again, lo! the Soul—above all science …
For it, the partial to the permanent flowing,
For it, the Real to the Ideal tends.
For it, the mystic evolution …”

Chapter 14 Blocks and Statements

“He was not merely a chip of the old block, but the old block itself.”

14.1. Normal and Abrupt Completion of Statements

“Poirot’s abrupt departure had intrigued us all greatly.”

14.8.1. The if-then Statement

“I took an early opportunity of testing that statement …”

14.18. The try statement

“These are the times that try men’s souls.”

“… and they all fell to playing the game of catch as catch can, till the gunpowder ran out at the heels of their boots.”

14.18.1. Execution of try-catch

“Our supreme task is the resumption of our onward, normal way.”

14.18.2. Execution of try-catch-finally

“After the great captains and engineers have accomplish’d their work,

After the noble inventors—after the scientists, the chemist, the geologist, ethnologist,
Finally shall come the Poet …”

14.19. Unreachable Statements

“That looks like a path.
Is that the way to reach the top from here?”

“One ought not to be thrown into confusion
By a plain statement of relationship …”

Chapter 15 Expressions

“When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge of it is of a meager and unsatisfactory kind: it may be the beginning of knowledge, but you have scarcely, in your thoughts, advanced to the stage of science.”

15.5. Normal and Abrupt Completion of Evaluation

“No more: the end is sudden and abrupt.”

15.6. Evaluation Order

“Let all things be done decently and in order.”

15.6.3. Parentheses and Precedence Respected

“That is too weighty a subject to be discussed parenthetically …”

15.11.2. Compile-Time Step 2: Determine Method Signature

“The hand-writing experts were called upon for their opinion of the signature…”

15.14.2. Prefix Decrement Operator —

“He must increase, but I must decrease.”

15.15. Cast Expressions

“My days among the dead are passed;
Around me I behold,
Where’er these casual eyes are cast,
The mighty minds of old …”

15.16.1. Multiplication Operator ·

“Entia non sunt multiplicanda praeter necessitatem.”

15.16.2. Division Operator /

“Gallia est omnis divisa in partes tres.”

15.16.3. Remainder Operator %

“And on the pedestal these words appear:
‘My name is Ozymandias, king of kings:
Look on my works, ye Mighty, and despair!’
Nothing beside remains.”

15.18. Shift Operators

“What, I say, is to become of those wretches?
… What more can you say to them than ’shift for yourselves?’”

15.20.3. Reference Equality Operators == and !=

“Things are more like they are now than they ever were before.”

15.27. Constant Expression

“… when faces of the throng turned toward him and ambiguous eyes stared into his, he assumed the most romantic of expressions …”

Chapter 16 Definite Assignment

“All the evolution we know of proceeds from the vague to the definite.”

16.2.13. try Statements

“I resolved to assign Bartleby a corner by the folding doors …
It does not strike me that there is anything definite about that.”

Chapter 17 Threads and Locks

“And oft-times in the most forbidding den
Of solitude, with love of science strong,
How patiently the yoke of thought they bear;
How subtly glide its finest threads along!”

17.5. Rules about Locks

“By the pricking of my thumbs,
Something wicked this way comes.
Open, locks,
Whoever knocks!”

17.12. Threads

“They plant dead trees for living, and the dead
They string together with a living thread …
But in no hush they string it … With a laugh, …
They bring the telephone and telegraph.”

17.14. Wait Sets and Notification

“These pearls of thought in Persian gulfs were bred,
Each softly lucent as a rounded moon;
The diver Omar plucked them from their bed,
Fitzgerald strung them on an English thread.”

Chapter 18 Documentation Comments

“The view that documentation is something that is added to a program after it has been commissioned seems to be wrong in principle, and counterproductive in practice. Instead, documentation must be regarded as an integral part of the process of design and coding.”

“Very few facts are able to tell their own story, without comments to bring out their meaning.”

Chapter 20 The Package java.lang

20.2. The Interface java.lang.Cloneable

“I am disappointed in Japp. He has no method!”

20.4. The Class java.lang.Boolean

“This above all: to thine own self be true,
And it must follow, as the night the day,
Thou canst not then be false to any man.”

20.5. The Class java.lang.Character

“Here is the whole set ! a character dead at every word.”

20.11. The Class java.lang.Math

“Oh, back to the days that were free from care in the ’Ology ’varsity shop,
With nothing to do but analyse air in an anemometrical top,
Or the differentiation of the trigonometrical pow’rs
Of the constant pi that made me sigh in those happy days of ours!”

“In mathematics he was greater
Than Tycho Brahe or Erra Pater
For he, by geometric scale,
Could take the size of pots of ale;
Resolve, by sines and tangents straight
Whether bread or butter wanted weight;
And wisely tell what hour o’ the day
The clock does strike, by algebra.”

20.15. The Class java.lang.Process

“It was my hint to speak—such was the process.”

Chapter 21 The Package java.util

21.2. The Class java.util.BitSet

“T is an old maxim in the schools,
That flattery’s the food of fools;
Yet now and then your men of wit
Will condescend to take a bit.”

“At Mooneen he had leaped a place
So perilous that half the astonished meet
Had shut their eyes, and where was it
He rode a race without a bit?”

21.5. The Class java.util.Hashtable

“… never did they seem to have new experiences in common … and the things they had for dissection—college, contemporary personality, and the like—they had hashed and rehashed for many a frugal conversational meal.”

“Twelve sphered tables, by silk seats insphered,
High as the level of a man’s breast rear’d
On libbard’s paws, upheld the heavy gold
Of cups and goblets, and the store thrice told
Of Ceres’ horn, and, in huge vessels, wine
Came from the gloomy tun with merry shine.
Thus loaded with a feast the tables stood …”

21.9. The Class java.util.Random

“Oh, many a shaft at random sent
Finds mark the archer little meant
And many a word at random spoken
May soothe, or wound, a heart that’s broken!”

“… who can tell what may be the event? …
The mind of the multitude is left at random …”

21.12. The Class java.util.Stack

“… and from the stack a thin blue wreath of smoke
Curled through the air across the ripening oats…”

“… And overhead in circling listlessness
The cawing rooks whirl round the frosted stacks…”

Appendix A Quoted works by authors

Addison, Joseph: A Letter from Italy
Bernardus Morlanensis: De contemptu mundi
Burke, Edmund: On Pitt’s First Speech
Burton, Robert: aphorism
Butler, Samuel: Hudibras
Caesar, Iulius: Commentarii de bello Gallico
Carroll, Lewis: Through the Looking Glass
Cervantes, Miguel de: Don Quixote
Christie, Agatha: The Mysterious Affair at Styles
Eisenhower, Dwight D.
Epictetus
Finagle: Finagle’s Law
Fitzgerald, F. Scott: This Side of Paradise
Foote, Samuel
Franklin, Benjamin
Frost, Robert Lee: Mending Wall · The Generations of Men · The Line-gang · The Mountain
Geisel, Theodore [Dr. Seuss]: Too Many Daves
Gilbert, William Schwenck, Sir: Iolanthe
Harding, Warren G.: Inaugural Address
Hoare, C. A. R.: Hints on Programming Language Design
Johnson, Samuel: Dictionary
Keats, John: Lamia · The Eve of St. Agnes
Lao-tzu: Tao te Ching
Litchfield, I. W.: Take Me Back to Tech
Melville, Herman: Bartleby, the Scrivener
Mill, John Stuart: On Liberty
Molière: Les Femmes Savantes
Montaigne, Michael de: Essais
Newton, Isaac, Sir
Paine, Thomas: Common Sense · The American Crisis
Partridge, Eric: Origins: A Short Etimology Dictionary of Modern English
Pierce, Charles
Quayle, J. Danforth
Russell, James: Lowell
Scott, Walter, Sir: The Lady of the Lake
Seuss, Dr. lásd: Geisel, Theodore
Shakespeare, William: Love’s Labour’s Lost · Two Gentlemen of Verona · As You Like It · Hamlet · Macbeth · Measure for Measure · A Midsummer Night’s Dream · Othello · Romeo and Juliet · The Winter’s Tale · Troilus and Cressida
Shelley, Percy Bysshe: Ozymandias
Sheridan, Richard Brinsley: The School for Scandal
Southey, Robert: Occasional Pieces
Stein, Gertrude: Sacred Emily
Swift, Jonathan: Cadenus and Vanessa
Thompson, William, Lord Kelvin
Whitman, Walt: Carol of Occupations · Passage to India · Song of the Broad-Axe · Song of the Universal
Wilde, Oscar: Charmides, Humanitad
William of Occam: Occam’s Razor
Wordsworth, William: Apology for the Foregoing Poems · Maternal Grief · Monks and Schoolmen · To the Same Flower
Yeats, William Butler: In Memory of Major Robert Gregory

Appendix B Quoted works by titles

Love’s Labour’s Lost—William Shakespeare
Commentarii de bello Gallico—Julius Caesar
The Mountain—Robert Lee Frost
Two Gentlemen of Verona—William Shakespeare
The School for Scandal—Richard Brinsley Sheridan
On Liberty—John Stuart Mill
The Lady of the Lake—Sir Walter Scott
De contemptu mundi—Bernardus Morlanensis
aphorisms—Robert Burton · Dwight D. Eisenhower · Samuel Foote · Benjamin Franklin · Sir Isaac Newton · Charles Pierce · J. Danforth Quayle · William Thompson (Lord Kelvin)
As You Like It—William Shakespeare
Through the Looking Glass—Lewis Carroll
Apology for the Foregoing Poems—William Wordsworth
The American Crisis—Thomas Paine
Origins: A Short Etimology Dictionary of Modern English—Eric Partridge
Bartleby, the Scrivener—Herman Melville
Bible—János evangéliuma, Korintusiaknak írt I. levél, Matthew evangéliuma
Cadenus and Vanessa—Jonathan Swift
Carol of Occupations—Walt Whitman
Charmides—Oscar Wilde
Don Quixote—Miguel de Cervantes
Finagle’s Law—Finagle
Hamlet—William Shakespeare
Hudibras—Samuel Butler
Humanitad—Oscar Wilde
Sacred Emily—Gertrude Stein
Inaugural Address—Warren G. Harding
This Side of Paradise—F. Scott Fitzgerald
A Letter from Italy—Joseph Addison
Iolanthe—Sir William Schwenck Gilbert
Common Sense—Thomas Paine
Essais—Michael de Montaigne
proverb
Lamia—John Keats
Tao te Ching—Lao-tzu
Les Femmes Savantes—Moliere
Lowell—James Russell
Macbeth—William Shakespeare
Maternal Grief—William Wordsworth
Mending Wall—Robert Lee Frost
Monks and Schoolmen—William Wordsworth
Occasional Pieces—Robert Southey
Occam’s Razor—William of Occam
Othello—William Shakespeare
Ozymandias—Percy Bysshe Shelley
Passage to India—Walt Whitman
On Pitt’s First Speech—Edmund Burke
In Memory of Major Robert Gregory—William Butler Yeats
Romeo and Juliet—William Shakespeare
Song of the Broad-Axe—Walt Whitman
Song of the Universal—Walt Whitman
Measure for Measure—William Shakespeare
The Eve of St. Agnes—John Keats
A Midsummer Night’s Dream—William Shakespeare
Dictionary—Samuel Johnson
Take Me Back to Tech—I. W. Litchfield
Hints on Programming Language Design—C. A. R. Hoare
The Winter’s Tale—William Shakespeare
The Generations of Men—Robert Lee Frost
The Line-gang—Robert Lee Frost
The Mysterious Affair at Styles—Agatha Christie
To the Same Flower—William Wordsworth
Too Many Daves—Theodore Geisel [Dr. Seuss]
Troilus and Cressida—William Shakespeare

(Source: James Gosling, Bill Joy, Guy Steele: The JAVA Language Specification. Version 1.0. Redwood: Addison-Wesley, 1996. The Java Series.)

The JAVA Language Specification

The number of quoted authors (writers, poets, scientists, politics, etc.) is fifty one; the number of quoted works (poems, plays, novels, detective stories, aphorisms, proverbs, etc.) is sixty two.

works by authors · works by titles