Learning Java: Beginning programming with java for dummies Bach
Learning Java: Beginning programming with java for dummies Bach
Learning Java: Beginning programming with java for dummies Bach
How to Configure Refusal of Applicants in Odoo 18 RecruitmentCeline George
Ad
Learning Java: Beginning programming with java for dummies Bach
1. Learning Java: Beginning programming with java
for dummies Bach pdf download
https://ebookmass.com/product/learning-java-beginning-
programming-with-java-for-dummies-bach/
Explore and download more ebooks at ebookmass.com
2. We have selected some products that you may be interested in
Click the link to download now or visit ebookmass.com
for more options!.
Beginning Programming with Java For Dummies 6th Edition
Barry Burd
https://ebookmass.com/product/beginning-programming-with-java-for-
dummies-6th-edition-barry-burd/
Java For Dummies 8th Edition Barry Burd
https://ebookmass.com/product/java-for-dummies-8th-edition-barry-burd/
Java Programming 9th Edition Joyce Farrell
https://ebookmass.com/product/java-programming-9th-edition-joyce-
farrell/
Beginning Programming with Python For Dummies 3rd Edition
John Paul Mueller
https://ebookmass.com/product/beginning-programming-with-python-for-
dummies-3rd-edition-john-paul-mueller/
3. Java Programming: A Comprehensive Introduction, First
edition
https://ebookmass.com/product/java-programming-a-comprehensive-
introduction-first-edition/
Introduction to Java Through Game Development: Learn Java
Programming Skills by Working with Video Games 1st Edition
Victor G. Brusca
https://ebookmass.com/product/introduction-to-java-through-game-
development-learn-java-programming-skills-by-working-with-video-
games-1st-edition-victor-g-brusca/
Beginning EJB 3: Java EE 7 Edition Jonathan Wetherbee
https://ebookmass.com/product/beginning-ejb-3-java-ee-7-edition-
jonathan-wetherbee/
(eTextbook PDF) for Murach’s Java Programming 5th Edition
by Joel Murach
https://ebookmass.com/product/etextbook-pdf-for-murachs-java-
programming-5th-edition-by-joel-murach/
Introduction to Programming with Java: A Problem Solving
Approach 3rd Edition John Dean
https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/
11. CONTENT
INTRODUCTION
J P E
BASIC STRUCTURES OF THE JAVA LANGUAGE
A ' J
C
D
C
B
Methods for working with large numbers
O
Converting numeric types
Cast
S
Union with t rock
Substrings
Editing a string
Checking strings for equalit y
Some methods of the String class
C
Block scope
Conditional statement if - else
Multivariate branching - switch statement
While and do - while loops
cycle for
Break statement
The continue statement
A
Copying arrays
12. Sorting arrays
Arrays Class Methods
Multidimensional array s
Command line parameters
C -
OBJECTS AND CLASSES
I O O P
OOP terminology
Differences between OOP and Traditional Procedural Programming
C
New operation
An example of using existing classes
C
Method overloading
The this keyword in constructors
A
S
Static fields
Static methods
I
P
Using packages
Adding a class to a package
Specifying the path to packages
Package scope
JAR files
C
INHERITANCE
E
O ( )
I
P
D
P I : T C M
A
P A ( , )
H
I
Interface operator
13. Implements statement
Constants in interfaces
EXCEPTIONAL SITUATIONS
C E
D M E
How to raise an exceptional situation
Creating Exception Classes
C ( - )
Catching multiple exceptions
Re-raising an exception
Finally section
H
I / O STREAMS
Reading and writing bytes
C
S
D
D F S
T
Writing text to the output stream
Reading text from an input stream
W
LETTER T HURRAY
Introduction
The Java language was created in the early 90's as part of a
software development project for consumer electronic devices. The
original new object-oriented programming language was named Oak
(oak) . With the development of network Internet language Oak was
used to create Internet-applications ( eg, n and this language was
written Oak-browser " WebRunner " ) . In 1995, Sun Microsystems
decided to announce a new product, renaming it Java (the only
reasonable explanation for the name is the love of coffee
programmers) , and WebRunner was renamed HotJava .
The Java language is now increasingly used to create " middleware "
that maintains communication between clients and server resources
. In addition, the Java language has taken over the leadership in
14. embedded systems , becoming the de facto standard for portable
devices , on-board car computers, and so on .
One of the main advantages of the Java language is independence
from the platform on which programs are executed: the same code
can be run under Windows , Solaris , Linux , Macintosh , etc.
Operating systems . Another advantage is that the syntax of the
Java language is similar to the syntax language s C ++ and C . In
addition, Java is a completely object-oriented language, even more
so than C ++. All entities in the Java language are objects, with the
exception of a few primitive types , such as numbers.
In contrast to C ++ , it is easier to develop error-free programs in
Java . The Java language provides tools to eliminate the very
possibility of creating programs that would hide the most common
errors. To do this, the Java language has done the following :
The possibility of explicit allocation and freeing of memory
has been excluded. Java memory is automatically reclaimed
by garbage collection. The programmer is guaranteed
against errors related to misuse of memory ;
Introduced true arrays and disallowed pointer arithmetic.
Now programmers, in principle, cannot erase data from
memory due to improper use of pointers ;
Eliminated the possibility of confusing the assignment
operator with the equality comparison operator . Now you
can not even compile the expression of the if ( a = 3) { ... }
(this error - the source of most confusion in the languages C
and C ++).
Multiple inheritance is excluded. It has been replaced by
the concept of interface a , borrowed from Objective C. An
interface gives the programmer almost everything a
programmer can get from multiple inheritance, while
avoiding the complexity of managing class hierarchies .
Java Program Execution
A program written in a high-level language (called a source module )
cannot be executed immediately . From the beginning it must be
15. Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
16. compiled, that is , translated into a sequence of machine instructions
- an object module. For boot th unit I of bektny module n uzhno build
the libraries used in the module and enable the cross-references
between the object module sections
The source module written in the language of the Java , could not
avoid these procedures, but here is shown the main feature of the
technology the Java - the program is compiled directly into machine
instructions, but does not command a particular processor, and in
the team's so-called in irtualn second machine s the Java ( JVM,
Java Virtual Machi ne ). The Java Virtual Machine is a collection of
commands along with their execution system. Note that the virtual
machine Java completely stack, and therefore does not require
complex th addressing of and memory cells and a large of quantity
and registers. By A team JVM short, most of which it has a length of
1 byte, so the JVM command called a byte - code ( bytecodes ),
although there are teams of length 2 and 3 bytes. Full description of
the commands and the entire JVM architecture is contained in a
virtual machine specification the Java (the VMS, the Virtual Machine
specifica tion of ).
Another feature of Java is that all standard functions that are called
in a program are connected to it only at run time, and are not
included in the bytecode. In other words, there is dynamic linking (
dynamic binding ) , which significantly reduces the amount of the
compiled program.
Since a program written in Java is translated by the compiler into the
bytecode of the Java Virtual Machine , it is independent of the type
of processor and architecture of the computer being used .
Therefore, bytecode can be performed and be on any computer with
a system that implements the JVM. In this case, neither the type of
processor nor the architecture of the computer is important. T. e
language. The Java - machine-independent. (Obviously, the
implementation of the Java virtual machine is platform dependent.)
Bytecode interpretation and dynamic linking slow down program
execution significantly. It does not matter when the bytecode before
ae tsya on the network - network slower than any interpretation ;
however , other situations require a powerful and fast computer. To
17. increase the speed of interpretation p azrabotany JIT-compiler ( "
timely " compilers - the Just - with In - Time The compiler ),
memories have interpreted sections of code to machine CPU and
simply performing these areas when re-treatment, for example, in
cycles. Only a specialized processor can provide the highest speed
of bytecode execution . The company of SUN Microsystems
released the microprocessors picoJava , running on the system JVM
command, e nce and Java-processors of other companies. These
processors directly execute bytecode.
And nterpreta tori JVM commands in a specific processor
instructions designed for virtually all computing platforms. More and
more operating systems and database management systems include
JVM implementation in their core. A special JavaOS operating
system has also been created , which is used in electronic devices.
Most browsers have a built-in Java virtual machine to run applets.
The company of SUN Microsystems - the creator of technology Java
- distributes a set of software tools required for a full cycle of
software development on the language ie Java under the name of
the JDK ( Java Development Kit ). There are toolkits from other
companies .
The JDK suite of programs and classes contains:
javac - source to bytecode compiler;
java - the interpreter containing the JVM implementation;
appietviewer - browser-replacement applet viewer
jdt - debugger;
javap - disassembler;
jar - pro gram archiving and compression (using the
format zip -files);
the javadoc - prog Ranma to generate documentation
from comments ;
javah - generating program language header file C ;
javakey - a program for adding an electronic signature;
native2ascii - a program that converts binary files to text;
rmic and rmiregistry programs for working with remote
objects;
18. serialver - the program that determines the version
number of the class;
libraries and header files of " built-in " methods;
Library classes Java API (Application Programming
Interface) and others .
The first version of the JDK 1.0 was released in 1996 g ode . Starting
with the version the JDK 1.2, which came out in December 1998 g .,
Food technology Java Company and SUN became and nazyvat sya
Java 2 Platform of Standard Edition , abbreviated J 2 SE , a the JDK
was pereimenova n in Java 2 of Standard Edition the SDK (
Software Development Kit ) , abbreviated as J 2 SDK . Also issue
were Java 2 Enterprise Edition the SDK and Java 2 Micro Edition the
SDK . ( However, the very company SUN until now has enjoyed ,
and the old name - the JDK .) With the version the JDK 1.6
packages means development began and nazyvat sya the Java
Platform of Standard Edition Development Kit ( the Java SE ) , the
Java Platform Enterprise Edition the SDK ( the Java EE ) and the
Java Platform Micro Edition SDK ( Java ME ). In addition , SUN
separately distributes a set of JRE ( Java Runtime Environment ) for
working with compiled Java programs .
Basic structures of the Java language
A simple Java program
Consider a simple program that prints a message to the console
window :
public class FirstSample
{
public static void main (String [] args)
{
System.out.println ("Hello, World!");
}
}
19. The first and main point is that in the Java language , uppercase and
lowercase letters are strictly distinguished. If , for example, Dialed
amb word Main instead of main , the program will not be executed.
The keyword public is called the access modifier ( access modifier );
such modifiers control access to this code from other parts of the
program. The keyword class reminds us that all of the entities in the
language Java is inside a class , t. E. In Neki x container x , in which
the logic of the program concluded, defining the application. Classes
are the building blocks that make up all applications and applets
written in the Java language . All entities in Java programs must be
inside classes.
The class keyword is followed by the class name. The rules for
generating class names are not too strict. The name must start with
a letter, and the rest of it can be any combination of letters and
numbers. The length of the name is practically unlimited. Java
reserved words (for example, public or if ) cannot be used as a class
name .
Classes are usually called nouns starting with an uppercase letter.
The file containing the source code must be named the same as the
public class and have the extension . j ava .
Compiling the program :
java c FirstSample . java
The Java compiler will automatically name this file FirstSample .
class and will save it in the directory containing the source file.
To redirect error messages to a file ( when working on UNIX or
Windows NT / 2000 / XP platforms ) , just use the 2> operator:
javac FirstSample . java 2> errors . txt
For in the Run eniya byte code and using an interpreter Java n
uzhno dial command
java FirstSample
( no extension . class ) .
20. When to start from the compiled program, use the command java
ClassName , language interpreter Java always starts with the
implementation of the method main of the specified class. Therefore,
for the program to run at all, the class must contain a main method .
In accordance with the specification of the language Java method
main must be declared public ( the public ) and static ( static ) . With
lovo void means that the method does not return any value.
The brackets in the source code of a program are used to mark parts
of the program (usually called blocks). In Java, the code of any
method must begin with an opening curly brace and end with a
closing curly brace ({…}) .
By azhdy operator must end with a semicolon. In particular, the end-
of-line character does not mean that the statement is terminated , so
the statement can span as many lines as needed.
In this example, for a text string output using tsya object System . out
and cause t Xia its method println , in which the text string is passed
as a parameter. Note that period is used to call the method.
In the language of the Java , as well as in the language of s C / C ++
for the designation used strings double quotes.
Java methods can have one or more parameters , or none at all .
Even if the method has no parameters, you must leave empty
parentheses. For example, there is a parameterless version of the
println method that prints an empty string to the screen. Its call looks
like this: System.out.println () .
Comments
Comments in Java , as in most programming languages, are ignored
when compiling a program. Thus, you can add as many comments
to the program as required without fear of increasing its size.
The Java language has three ways to highlight comments in text.
The most common use of two forward slashes is //, whereby the
comment begins immediately after the // characters and continues to
the end of the line. In addition, the delimiters / * and * / can be used .
21. T retya variety comments mozh is ispolzovat sya for automatic
generation of documentation. These comments begin with / ** and
end with * /. The javadoc utility is used to automatically generate
documentation . exe .
Data types and variables
The Java language is strongly typed. This means that the type of
each variable must be declared.
In the language of Java , there are eight basic types ( primitive types
) data. Four of them are integers, two - to the actual floating- point,
one is a character type char , used to represent characters in the
format of the Unicode , and the latter - a boolean type boolean - is
used for logical values.
There is no concept of unsigned numbers in Java .
Table 1 . Data types
A type Size in bytes Change interval
int 4 o t - 2147 483648 up to 2147483647
short 2 from -32768 up to 32767
l ong 8
o t -
9223372036854775808L
up to
922337203685477580
7 L
byte 1 o t - 12 8 up to 1 27
float 4 from - 3.4 02823 47 Е
38 F
up to 3.4 02823 47 E +
38 F
double 8 from - 1.7976931348623 1
57 E + 308
D o 1.79769313486231
57 E + 308
char 2 from 0 ( ' u0000 ' )
up to 65535 ( ' uFFFF
' )
Long integers have an L suffix ( for example, 4000000000L).
Hexadecimal numbers are prefixed with 0 x ( for example, 0 xCAFE
or 0 xcafe ). Octal numbers are prefixed with 0. For example, 010 is
8 10 .
Float numbers have an F suffix, for example 3.402F. Floating point
numbers having no suffix F ( e.g., 3.402), are always treated as the
22. number of type double ( with double precision ) . You can (but not
necessarily) use the D suffix to represent them, for example 3.402D.
All calculations performed on floating point numbers follow the IEEE
754 standard. In particular, the Java language has three special
floating point numbers:
positive infinity (constant Double . POSITIVE _ INFINITY )
;
negative infinity (constant Double . NEGATIVE _
INFINITY ) ;
NaN (not a number) ( constant Double. NaN ) .
They are used to indicate overflow and error. For example, dividing a
positive number by 0 equals positive infinity. Evaluating 0/0 or taking
the square root of a negative number is NaN.
For constants of type char , single quotes are used. For example, ' H
' is a character. It differs from "H" , which is a single character string.
In Java to represent the characters are encoded the Unicode , so the
value of the type as char coded 2-byte of vym code. Unicode is the
union of dozens of character encodings ; it includes Latin, Greek,
Arabic alphabets, Cyrillic and many other character sets.
Unicode character codes are usually expressed as hexadecimal
values from ' u0000' to ' uFFFF' . The u prefix means that the
character is in Unicode format , followed by four hexadecimal digits
that identify the character. For example, ' u2122 ' is a trademark
(™) symbol .
With quantities of type char mozh but handled as integers . This
makes it possible to add two characters together, or to increment the
value of a character variable :
The Java language has a simple boolean type used to store boolean
values. Variables of this type can take only two values - true (true)
and false (false). Values of type boolean return as a result of all
comparison operators .
Note that the variable name must also begin with a letter and be a
combination of letters and numbers. The terms "letters" and
"numbers" in Java have a broader meaning than in most other
programming languages. Letters are considered Sim oxen ' A' - ' the
23. Z', 'a' - ' the z ', '_' and any symbol encoding the Unicode . Similarly,
both ordinary decimal digits '0' - ' 9 ' and any Unicode characters
used to denote a digit in any language are considered digits. The
use of other characters in identifiers is prohibited. All characters in
the variable name are important, and the case of the keyboard also
matters. Variable name length is not limited. You cannot use
reserved words as variable names.
In the language of Java size ad is, and determining the e variables
do not differ.
After declaring a variable, you must explicitly initialize it using the
assignment operator. For example :
int vacationDays ; // This is a declaration
vacationDays = 12; // This is an assignment operator
int index = 0 xffffffff ; // -1
long number = 25 L ;
float result = 2.5 F ;
double pi = 3.14159;
char c1 = 0x f132;
char c2 = 'a';
char c3 = ' n';
char c4 = ' u2122 ' ;
boolean done = false ;
The basic form of a variable declaration is as follows:
type identifier [= value] [, identifier [= value 2 ...];
Type - is either one of the built-in types so . e . byte , short , int , long
, char , float , double , boolean , or the name of a class or interface.
Constants
The Java language uses the final keyword to denote constants , for
example:
public class Constants
{
public static void main (String [] args)
{
final double CM_PER_INCH = 2.54 ;
24. double paperWidth = 8.5;
double PaperHeight = 11;
System . out . the println ( " The size of the page in
inches "
+ paperWidth * CM_PER_INCH + " on "
+ paper H eight * CM _ PER _ INCH );
}
}
The final keyword means that you can assign a value to a given
variable only once. It is not necessary to use only uppercase letters
in constant names .
In the Java language , you often need constants that are available to
multiple methods within the same class. They are usually called
class constants . Class constants are declared using the static final
keywords . Here's an example using a class constant :
public class Constants 2
{
public static final double CM_PER_INCH = 2.54;
public static void main (String [] args)
{
...
}
}
Note the fact that the class constant is defined outside the main
method . Thus, it can be used in other methods of the same class.
Moreover, if (as in this example) a constant is declared public ,
methods from other classes can also access it. In our example, this
can be done using the expression Constants 2. CM _ PER _ INCH .
Big numbers
If the precision of the built-in integer and floating point types is not
sufficient , you can refer to the two classes in the Java package .
math called Big I nteger and BigDecimal . These classes are
25. designed to manipulate numbers consisting of an arbitrary number of
digits. The Big I nteger and BigDecimal classes implement arbitrary
precision arithmetic on integers and real numbers, respectively.
To convert an ordinary number to “ large ”, use the method
valueOf . Big I nteger a = Big I nteger.value O f (100);
The usual mathematical operators “ + ” and “ * ” cannot be applied to
large numbers . Instead, you need to use the add and multiply
methods from the classes to work with large numbers :
Big I nteger with = a . add ( b ); // c = a + b
BigI nteger d = c .multiply (b.add (BigInteger.valueOf (2)));
// d = c * ( b + 2)
Methods for working with large numbers
java.math.Big I nteger 1.1
Big I nteger add (Big I nteger other)
Big I nteger subtract (Big I nteger othe r)
Big I nteger multiply (Big I nteger other)
Big I nteger divide (Big I nteger other)
Big I nteger mod (Big I nteger other)
These functions return the sum, difference, product, quotient, and remainder of
a given large number by the value of other .
int compa reTo (Big I nteg e r other)
Returns 0 if the given large number is equal to the value of other, a negative
number if the given large number is less than the value of other, and positive
otherwise.
static Big I nteger valueOf (long x)
Returns a large number equal to the value of x.
java.mathBigDecimal 1.1
BigDecimal add (BigDecimal other)
BigDecimal subtract (BigDecimal other)
BigDecimal multiply (BigDecimal other)
BigDecimal divide (BigDecimal other, int roundingMod e)
Returns the sum, difference, product, and quotient of a large decimal number
by the value of other . To calculate the quotient, you need to support the
rounding mode. BigDecimal ROUND_HALF_UP means normal rounding (that
is , downward if the last digit is less than 5, and upward if it is greater than 5).
26. Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
36. Footnotes
1. Yet they seem to have regarded experience and common-sense
remedies as a part of natural means, since they made use of
ordinary home remedies and good nursing.
2. Although New London, at that time, included all that is now
known as Groton, Ledyard, Stonington, Montville, Waterford and
East Lyme, we find, by the proportion which James Rogers paid for
the support of the minister, that his property amounted to about
one-tenth of that of the entire plantation. The minister’s salary was
£80 a year. Says Miss Caulkins: “Rate lists for the minister’s tax are
extant for the years 1664, 1666 and 1667. In this list the amount of
each man’s taxable property is given and the rate levied upon it is
carried out. The assessment of James Rogers is nearly double that
of any other inhabitant.” His rate was £7 19s. 10d., nearly three
times that of Governor Winthrop, which was £2 14s.
3. The first Baptist church of Newport was formed before May,
1639, by some excommunicated members of the church at Boston
and others. From its organization, it rejected the supervision of civil
magistrates. Dr. John Clarke was its founder and first pastor. In
1671, several member of Mr. Clarke’s church organized themselves
into the Sabbatarian or Seventh Day Baptist Church of Newport
(then Aquedneck) which James Rogers and his family joined, as
above stated.
4. It will be understood that while “profaning” the first day
Sabbath, they were strictly keeping the scriptural seventh day
37. Sabbath.
5. For particular account of this and a previous countermove, see
Part II, Chap. 2.
6. About 1705, the Rogerene Society came to the conclusion that
the Jewish Sabbath and ordinances were, according to the teachings
of the New Testament, done away with by the new dispensation,
and they began to hold their meetings on Sunday as the more
convenient day. See Part II, Chap. VI.
7. During the countermove, 1764-1766. See Part II, Chapter XII.
8. Here John Rogers quotes from Peter Pratt.
9. That this was the true ground, both on the part of the
Griswolds and the General Court, is patent in the light of the many
evidences, but this being untenable ground for a divorce, an
ostensible cause was presented by the Griswolds, which, upon
investigation by the grand jury, brought forth “we find not the bill.”
The divorce was, therefore, granted upon no legal grounds and with
no stated cause. For the authenticated facts, see Part II, Chapter XI.
10. This act was not materially different from the former laws of
this kind.
11. We have been unable to find any historical account of Banks
and Case; but that any of the Quakers were “lewd men,” is so
incredible as to need more proof than the mere assertion of Peter
Pratt.
12. Governor Winthrop.
13. Not for baptizing a person, but for going to baptize a person,
was Rogers arrested. “Yet,” said Gov. Saltonstall, “there never was
any one that suffered on account of his different persuasion in
religious matters from the body of this people.” The law against
38. baptizing (other than by the standing order) was simply a fine for
every such baptism.
14. Abundant proof of the prominent stand taken by John Rogers
himself in behalf of religious liberty will be found not only throughout
this volume but by extracts from his writings to be found in
Appendix.
15. This “Message” of John Bolles was written when the
Rogerenes were not under virulent persecution, of which there was
cessation after the death of Gov. Saltonstall (1724) until the time of
Mather Byles over thirty years later. See Part II.
16. This is an error. He became a Rogerene after the Rogerene
Society had given up the Seventh Day Sabbath.
17. Such religious debates were common in those days between
persons of different persuasions, especially ministers, elders, etc.
18. The fact that prim still grows abundantly upon the farm once
owned and occupied by John Rogers, may be an exception worthy of
note.
19. Apparently, Mr. McEwen judged the Puritan Sabbath to have
been one and the same with the “religion of the gospel.”
20. Thomas Turner came to New London, as a young man, about
1721. He married Patience, daughter of John Bolles, in 1727. She
died December 18, 1769, aged sixty-one. After her death he married
Mary (née Harris), widow of John Waterhouse 2d, and after her
death he married Isabel Whitney. His first marriage was by the
regular form common with the New London Rogerenes; his second
and third marriages were by the Quaker form prevalent in
Quakertown at that date, and were recorded by Joseph Bolles, clerk
of the Rogerene Society. See Chapter XIV. Thomas Turner lived in
Montville. He died in 1791, aged ninety-two.
39. 21. “Secretary Bolles” is mentioned in the Biglow Papers. He wrote
an “Essay on Usury and Usury Laws,” published by the Boston
Chamber of Commerce, which led to the suspension of usury laws
on short bills of exchange.
22. Obituary Notice of Elder Peter Rogers, by Rev. J. M. Peck, D.D.,
of Illinois. Published in the Minutes of the Pastoral Union for 1850.
23. Later a professor in Chicago University.
24. This young man reproduced, from a description given him by
his grandmother, Mrs. Haven, the old John Rogers house, near which
Mrs. Haven lived in her youth, and where she used to visit her aunt
Elizabeth Rogers. (See the Genealogy entitled “James Rogers and
His Descendants,” for the drawing by Mr. Thrall.)
25. Her daughter, Anna Hempstead Branch, is now well known as
one of our young poets.
26. Not to be confounded with Bolles Hill where Joshua Bolles
resided, which is a mile and a half from above location.
27. The parentage and native place of James Rogers remain
undiscovered. He may, or may not, have been the James Rogers
who came over in the Increase (Hotten). There were several of the
same name and date in New England. There is a tradition in the New
London family, which can be traced as far back as 1750, that James
Rogers of New London was a grandson, or greatgrandson, of John
Rogers the martyr. Up to this date (1904) no proof has been found
to substantiate this claim. The same claim has been made by
descendants of other first settlers of the name of Rogers, and their
traditions are also proven to have been of early date. These long-
standing and very persistent traditions may possibly be explained by
some future discovery.
28. 1679—James Rogers sells Thos. Parker 50 A. of land that were
granted James Rogers of N. London, by the Gen. Court, he being a
40. Pequot soldier.—New London Land Records.
Also in “Memorial History of Hartford,” by J. Hammond Trumbull
(pub. 1886), p. 81, is a chapter on the Pequot War, by Rev. Increase
N. Tarbox, which names the men from Saybrook, viz. “John
Underhill, Edward Pattison, James Rogers, Edward Lay, John Gallup
and John Wood.”
29. An ancient mill built in 1728, on or very near the site of the
first mill, is still standing (see “Hempstead Diary,” page 200). Less
than fifty years ago, the cove was a beautiful sheet of water
commencing just in front of the mill, separated from it by little more
than the width of the winding street, and from thence stretching out
in rippling, shining currents to the river. This cove has been so filled
in of recent years that considerable imagination must be exercised to
reproduce the ancient sweep of clear, blue water known as
Winthrop’s Cove.
30. In 1664 he gave his son Samuel land “by the mill” “west side
of my wharf.”
31. Occupied by his son-in-law after Mr. Winthrop’s removal to
Hartford In 1657.
32. Still to be seen in “Book of Crimes and Misdemeanors,” in
State Library, Hartford.
33. See same “Book of Crimes and Misdemeanors” for Marriage
Settlement.
34. In after life he was accustomed to say that it was the richest
cargo he ever shipped and the best bargain he ever made.—History
of New London.
It was a frequent custom in those days, for persons emigrating to
the colonies to pay the expenses of their passage by selling their
services for a term after landing. Such passengers were called
“redemptioners.” Thus, Captain James actually purchased, as the
term was, his wife Mary.
41. 35. The account given by their son of this joint conviction of John
Rogers and his wife furnishes evidence of a considerable period in
which they were in full friendship and accord after the disclosure
made to the wife. For account, see Part I, Chapter III.
36. There were, on the law books, so-called capital crimes which
were never punished as such. “Man-stealing” was a so-called capital
crime, yet we shall find, further on, that it was punishable by an
ordinary fine. No mention is made on the court records or files of the
crime of which John Rogers was accused by the Griswolds, on
charge of which he was examined at Hartford. No record was made
of this matter, and we have only vague mention on the court files of
the petition of Elizabeth for this divorce by which to even conjecture
the nature of the charge.
37. Here is an apparent variation, at the outset, from the Newport
church.
38. By negroes is meant negro and Indian servants or slaves, of
which there were a number in the Rogers family, the slaves being
held for a term of years.
39. That John Rogers could not be induced to either admit or deny
the charge presented for the purpose of obtaining the divorce, is
from a statement to that effect made by Peter Pratt, in “The Prey
Taken from the Strong.” This is one of the few statements made in
that pamphlet, which seem likely to be true and are not invalidated
by proof to the contrary. It will be seen that, at a later date, this
attitude of complete silence is frequent with the Rogerenes, before
the court.
40. May 25, 1675.
“The testimony against him was his own wife—to whom he told it
all with his own mouth, and not in trouble of mind, but in a boasting
manner as of free grace, yt he was pardoned. This was much about
ye time he fell into yt cursed opinion of anabaptism.”—Journal of Mr.
42. Bradstreet. (See “New England Genealogical and Historical Register,”
Vol. 9, p. 47.)
With above compare:—
“After it pleased God, through His rich grace in Christ Jesus, to
take the guilt of my sins from my conscience and to send the Spirit
of His Son into my heart, whereby he did reveal unto me His love
and His acceptance of me in Jesus Christ, this unspeakable mercy
did greatly engage my heart to love God and diligently to search the
Scriptures, that thereby I might know how to serve God acceptably,
for then I soon became a seeker how to worship God.”—Epistle of
John Rogers to the Seventh Day Baptists.
“And the coming to witness the truth of those Scriptures, by God’s
giving him a new heart and another spirit, and by remitting the guilt
of his sins, did greatly engage him to love God with all his heart and
his neighbor as himself.”—John Rogers, Jr.—Reply to Peter Pratt.
41. See preamble to will of James Rogers, Part I., Chapter I.
42. See “History of Stratford.”
43. An evident attempt is made by the Griswolds, in inserting this
item in the bill for damages, to lay the illness of Elizabeth following
the birth of her child to some failure on the part of the young
husband to suitably provide for her confinement. Her son, John
Rogers, 2d, however, in his “Reply” to his half-brother, Peter Pratt,
mentions a far more serious and lengthy illness that befell Elizabeth
upon the birth of her latter son, during which illness both she and
her husband, Peter Pratt, Sr., had great misgivings regarding the
justice of her divorce from John Rogers. That the illness in either
case was of a constitutional origin is indicated by the parallel cases.
44. Elizabeth afterwards appears to have all the rents towards
support of the children. Later, when the children are grown, she
gives up the farm to John Rogers, for a reasonable consideration, as
will be seen.
43. 45. The facts contained in this chapter, not otherwise indicated,
are from Letters of Mr. Samuel Hubbard.
46. Prayers an hour or more in length were common at that time.
47. Before long, the Newport church sends Mr. Gibson to live and
preach upon the Great Neck, to such Sabbatarians as hold merely
with the doctrines and customs of that church. Between this pastor
and John Rogers, pastor of the still newer departure, we find no
evidence of collision.
48. This farm is afterwards conveyed to Jonathan, with other
valuable property, by the will of his father.
49. A prominent Seventh Day Baptist of England.
50. This statement of Governor Leete has been quoted against the
Rogerenes again and again.
51. It will be remembered that the officers were themselves liable
to be fined if they failed to execute the Sunday laws, and that any
religious meetings whatever other than those prescribed by the
standing order were against the law, both those holding and those
attending such meetings being liable to fine or—in case of non-
payment—imprisonment.
52. They were forced to pay for bed and board during
imprisonment. Sometimes a prisoner brought a bed of his own.
53. From Reply of John Rogers, 2d, to Peter Pratt, 2d.
54. The failing health of James Rogers, Sr., is sufficient to account
for his not being arrested for servile work at this time.
55. It will later be seen that the custom, on such occasions, of
ejecting disturbers of meeting from the church in a violent manner,
was calculated to create a general excitement among the spectators.
44. 56. That no actual relapse to Quakerism had occurred at the time
should have been evident from the fact that John Rogers is, even in
this very month of June, baptizing, and undoubtedly as usual
administering the Lord’s Supper, ordinances to which the Quakers
were entirely opposed.
57. See “Prey Taken from the Strong,” and Reply to same by John
Rogers, 2d.
58. See Part I, Chap. I. For full preamble, see “James Rogers and
His Descendants,” by J. S. Rogers, Boston.
59. In point of fact, only one of the children made any complaint
regarding boundaries; but this complaint resulted in a suit that was
carried through several courts. Undoubtedly, by a cursory view of
this frequently appearing suit and also that of Samuel Beebe, on the
records, Miss Caulkins judged that there was a general “contention.”
Rev. Mr. Blake, in his Church History—New London Congregational—
in adopting this error of Miss Caulkins, has rendered it that “the
children” of James Rogers “engaged in bitter controversies” over his
estate.
60. Stephen Prentis eventually became one of the prominent and
wealthy citizens of the place, a holder of local and colonial offices,
captain of a train band, attorney and also a farmer on a large scale.
He was a member of the Congregational church through life, as was
also his wife. Their home farm was near what is now Mill Stone
Point.
61. Miss Caulkins states that his mother afterwards attempted to
secure his return to her, but could not succeed in overcoming his
determination to remain with his father. The evidence of this has
escaped our observation.
62. His son states (see Part I) that his imprisonments amounted to
one-third of his life after his conversion, viz.: one-third of the period
between 1674 and 1721.
45. 63. Contributions of articles, even of clothing, for the poor, for the
minister or for church adornment, and other purposes, were
common in those days; and for such donations there was a large
box, quite stationary, and usually near the pulpit. This appears not to
have been known to Miss Caulkins, who supposes a box to have
been passed around, as the box for money contributions of later
times.
64. For Apology, see Part I, Chap. I.
65. This thirteen acres is called a “grant to Robert Hempstead” “in
the first division.” It is probably the lot belonging to the house she
occupies, viz.: the home lot of her husband. It is a part of the land
willed to Captain James.
66. It afterwards appears that this movable estate included a
number of young slaves, commonly called “servants.”
67. It appears it was the intention of the widow that Joan should
not be transferred to Elizabeth until after her own decease; since we
do not find Samuel Beebe claiming and demanding her until some
time after that event, although it appears evident that this gift was
designated by the widow at about this time, 1692.
68. By the codicil John and Bathsheba are first to take what they
wish of “the things about the house,” the other movables
“whatsoever” to be divided by John, Bathsheba and James among
themselves.
69. This may refer in part to his mother’s deposition, which figured
in the evidence before the arbiters to the effect that Joseph had “not
just cause to molest Jonathan.”
70. This protest by Joseph’s wife is recorded on the New London
land records, under the deed of gift of 1670.
46. 71. Mr. Thomas Young must have been an earnest seeker after
truth, or he would not have braved the opposition of his
Congregational friends by opening his house to a meeting of the
Rogerenes. He appears to have been a son, or grandson, of Rev.
John Young, of Southold, L.I., a Puritan of so true a stamp that he
was forbidden to embark for America. Evidently New London did not
prove a satisfactory residence for Mr. Thomas Young, since he
eventually removed to Southold, where his friendship with John
Rogers continued, as also after his later removal to Oyster Bay, L.I.
72. For record evidence, see Chapter V.
73. Apparently the Scripture expounded on this occasion was
Romans viii.
74. Probably shoes of his own manufacture.
75. It is from the account of Mr. Bownas (conversation with John
Rogers) we gain knowledge that there were “goods” in the
wheelbarrow, which were offered for sale before the pulpit. The
court record mentions only the wheelbarrow. Mr. Bownas had
evidently a mixed recollection of this portion of John Roger’s
conversation (relating to work, etc., upon the first day Sabbath),
since he appears to suppose this was a thing that might have
happened more than once, whereas it was an extraordinary measure
suited to an extraordinary occasion, and one which would surely
receive court notice and record.
In his conversation with Mr. Bownas, John Rogers also said, in this
connection, “that the provocations he met with from the priests, who
stirred up the people and the mob against him, might sometimes
urge him further than he was afterwards easy with in opposing
them, but that when he kept his place he had inexpressible comfort
and peace in what he did;” adding, “the wrath of man works not the
righteousness of God.”
47. 76. “I John Rogers, a servant of Jesus Christ, here make an open
declaration of war against the great red dragon and against the
beast to which he gives power; and against the false church that
rides upon the beast; and against the false prophets who are
established by the dragon and the beast; and also a proclamation of
derision against the sword of the devil’s spirit, which is prisons,
stocks, whips, fines and revilings, all of which is to defend the
religion of devils.”
77. The “&c.” is of the record.
78. Although the “Proclamation” put out at the prison window
appears (by absence on the court records) not to have figured in
open court, it was evidently in the minds of these priestly judges.
79. After diligent search, no evidence has been found of enmity on
the part of the Rogerenes towards the Stonington church.
80. Miss Caulkins says regarding this burning of the meeting-
house: “It was supposed to be an act of incendiarism, and public
fame attributed it to the followers of John Rogers. Several of these
people were arrested and tried for the crime, but it could not be
proved against them, and they may now without hesitation be
pronounced innocent. Public sympathy was enlisted on the other
side, and had they committed a deed which was then esteemed a
high degree of sacrilege, it is difficult to believe they could have
escaped exposure and penalty.”
81. The capital crime with which he was charged appears not to
have been well-proven, for which reason the condemned prisoner
petitioned that there might be a fuller investigation. (See Book of
Crimes and Misdemeanors, State Library.) The fact that, although
meriting severe punishment, this youth was not guilty to the extent
presumed by the penalty, is indicated by his after reprieve.
82. Where he was doubtless confined for his “disturbance outside
the meeting house” in the recent countermove, the “ten stripes”
48. being too mild a punishment.
83. A very distinct glimpse of the power given to ministers of the
standing order in state legislation.
84. The words spoken do not appear on record.
85. It would be interesting to know exactly what doctrine or
doctrines were involved. By the occurrence of this suit so soon after
John Roger’s release from an imprisonment on charge of
“Blasphemy,” it would seem not unlikely that the Scripture
expounded at the house of Thomas Young in 1694 (probably
Romans viii) might be that in question. Public “disputes” of this kind
were then and for many years after in vogue in Connecticut.
86. For full title, see publications of John Rogers, at end of
Appendix.
87. This fact is revealed by after procedures regarding settlement
of the residue of the estate, her death not being found on record.
88. The County Court record says Mary was fined for “threatening”
to pour scalding water on the head of the collector. Miss Caulkins
inadvertently says she was fined for “pouring” the same.
89. In this treatise “On Divorce,” he shows that the New
Testament admits but one cause for divorce, and does not admit
adultery as a cause. Therefore (by inference), although, by her after
marriages, his first wife leads an adulterous life (see statement of his
son, Part I., Chapter IV.), he does not consider that this fact releases
him from his marriage bond. But since, by the law of God (“Mosaic”
and still prevailing in the time of Christ), a man was allowed another
than his first and chiefest wife, in taking Mary Ransford for his wife
under the forced separation from his first wife, he breaks no law of
God. Not that he so much as mentions himself, Elizabeth or Mary in
this treatise; but the above is plainly inferable to those acquainted
with his history at this period. Since, in granting the divorce to
49. Elizabeth, the court left him free to marry again, he broke no civil
law in taking another wife.
90. It may be left to legal judgment to decide whether this
marriage was not more in accordance with the spirit and letter of the
law than was the divorce granted by the General Court of
Connecticut, through no testimony save that of a wife, bent on
divorce, against her husband, regarding a matter which he had
confided to her in marital confidence; said divorce being granted in
the very face of the “we find not the bill” rendered by the grand jury
in regard to the charge made by the wife.
91. Everything involved in the command to “render to Cæsar,” etc.,
being a law of Christ, he held binding, as regarded ordinary civil
legislation.
92. Mary’s account in her petition to the General Court, 1703. See
“Book of Crimes and Misdemeanors,” Court Files.
93. The statements in this paragraph are from an affidavit still
extant at New London, in the handwriting of John Rogers.
94. “Prey Taken from the Strong.”
95. See account of this court scene, by John Rogers, 2d. (Part I.,
Chapter V.).
96. Miss Caulkins states that Mary was threatened by this court
with heavy penalties if she returned to John Rogers. Although the
evidence of this has escaped our notice, Miss Caulkins doubtless
came across such evidence.
97. This “afraid of my life” is a common expression, and was
especially so formerly, by way of emphasis. Matthew Beckwith could
not have been actually afraid of his life in regard to a man whose
principles did not allow of the slightest show of physical force in
dealing with an opponent. Although the court record says that John
50. Rogers “used threatening words against Matthew Beckwith,” on
presentation by Matthew Beckwith’s complaint, this does not prove
any intention of physical injury.
98. This by his statement to Mr. Bownas at this date.
99. This shows us that at a date long prior to the time when we
shall find a sturdy band of Rogerene youth, of Rogers and of Bolles
blood, on Quaker Hill, there was no lack of young people in training
to carry forward this cause.
100. He makes no mention of this occurrence in his book.
101. “Prey Taken from the Strong.”
102. Their services for preaching and expounding were always
public; their (evening) meetings for prayer and praise were for
believers, after the manner of the early church.
103. “Things about the house John and Bathsheba must take
them first before the others be divided.”—Codicil.
104. The pedigree of John Bolles in the male line is traceable to
time of the Conqueror. The name is on the Roll of Battle Abbey.
105. The Thomas Bolles place is now the Lyman Allyn farm on the
Norwich road. Just south of the Allyn house is the site of an old well.
By this well stood the house of Thomas Bolles, where occurred the
murder of his wife and two children, leaving only the babe, John.
(For particulars, see “Bolles Genealogy.”)
106. His house stood just south of present house of Mr. Calvert.
His father’s home farm was about one-fourth of a mile south of this
point.
107. John Bolles further says in regard to the persecution he
suffered upon joining the Rogerenes: “God gave me such a cheerful
51. spirit in this warfare, that when I had not the knowledge that the
grand-jury man saw me at work on said day, I would inform against
myself before witness, till they gave out and let me plow and cart
and do whatsoever I have occasion on that day.”
Here will be recognized an imitation of the early policy of the
Rogerenes in time of persecution, a policy likely to have been
recommended to all their followers; viz.: to give their opponents so
much more trouble when molesting them than when letting them
alone that the institution of a season of severe measures will be the
less liable to occur. This is the policy recognizable in the
countermove, so sure to take place in time of severe persecution.
108. It will be seen that as late as 1716 (see Chapter IX.), so
prominent a Rogerene as John Bolles was even declared to be
“ignorant of this law.” That he ignored it, with all other ecclesiastical
laws, is more likely to have been the case.
109. A Baptist church springs up at Groton and one on the Great
Neck. The Baptist edifice on the Great Neck (“Pepper Box”) is used
in an admirably liberal and pacific manner by both the regular
Baptists and the Seventh Day Baptists. The leading members of
these two friendly societies are largely of Rogers descent;—
descendants of Captain James and of Joseph being of the first-day
persuasion, and those of Jonathan of the seventh day, as a rule.
Since the history of these societies on the Great Neck has been
given by Miss Caulkins more largely than would be possible in this
work, the reader is referred to the “History of New London” for
particulars regarding them.
110. For what cause or by what pretense this imprisonment occurs
does not appear. It is revealed by a statement made by Peter Pratt
himself. (“Prey Taken from the Strong.”) In referring to his being
imprisoned with other Rogerenes, he speaks of his wife as a bride at
that time. He was married in 1709.
111. In his own large inventory is no mention of any slaves.
52. Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookmasss.com