SlideShare a Scribd company logo
Java How To Program Early Objects Eleventh
Edition Deitel Harvey M Deitel download
https://ebookbell.com/product/java-how-to-program-early-objects-
eleventh-edition-deitel-harvey-m-deitel-22004936
Explore and download more ebooks at ebookbell.com
Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel
Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel
Java™ How to Program
Early Objects
ELEVENTH EDITION
Deitel Series Page
How To Program Series
Android™ How to Program, 3/E
C++ How to Program, 10/E
C How to Program, 8/E
Java™ How to Program, Early Objects Version, 11/E
Java™ How to Program, Late Objects Version, 11/E
Internet & World Wide Web How to Program, 5/E
Visual Basic 2012 How to Program, 6/E
Visual C# How to Program, 6/E
Deitel® Developer Series
Android™ 6 for Programmers: An App-Driven Approach, 3/E
C for Programmers with an Introduction to C11
®
®
®
C++11 for Programmers
C# 6 for Programmers
Java™ for Programmers, 4/E
JavaScript for Programmers
Swift™ for Programmers
Simply Series
Simply Visual Basic 2010: An App-Driven Approach, 4/E
Simply C++: An App-Driven Tutorial Approach
VitalSource Web Books
http://bit.ly/DeitelOnVitalSource
Android™ How to Program, 2/E and 3/E
C++ How to Program, 9/E and 10/E
Java™ How to Program, 10/E and 11/E
Simply C++: An App-Driven Tutorial Approach
Simply Visual Basic 2010: An App-Driven Approach, 4/E
®
®
®
Visual Basic 2012 How to Program, 6/E
Visual C# How to Program, 6/E
Visual C# 2012 How to Program, 5/E
LiveLessons Video Learning
Products
http://deitel.com/books/LiveLessons/
Android™ 6 App Development Fundamentals, 3/E
C++ Fundamentals Java SE 8™ Fundamentals, 2/E
Java SE 9™ Fundamentals, 3/E
C# 6 Fundamentals
C# 2012 Fundamentals
JavaScript Fundamentals
Swift™ Fundamentals
REVEL™ Interactive
Multimedia
®
®
®
REVEL™ for Deitel Java™
To receive updates on Deitel publications, Resource Centers,
training courses, partner offers and more, please join the Deitel
communities on
Facebook —http://facebook.com/DeitelFan
Twitter —http://twitter.com/deitel
LinkedIn —http://linkedin.com/company/deitel-&-
associates
YouTube™—http://youtube.com/DeitelTV
Google+™—http://google.com/+DeitelFan
Instagram —http://instagram.com/DeitelFan
and register for the free Deitel Buzz Online e-mail newsletter
at:
http://www.deitel.com/newsletter/subscribe.html
To communicate with the authors, send e-mail to:
deitel@deitel.com
For information on programming-languages corporate training
seminars offered by Deitel & Associates, Inc. worldwide,
write to deitel@deitel.com or visit:
http://www.deitel.com/training/
®
®
®
®
®
For continuing updates on Pearson/Deitel publications visit:
http://www.deitel.com
http://www.pearsonhighered.com/deitel/
Visit the Deitel Resource Centers, which will help you master
programming languages, software development, Android™
and iOS app development, and Internet- and web-related
topics:
http://www.deitel.com/ResourceCenters.html
®
Java™ How to Program
Early Objects
ELEVENTH EDITION
Paul Deitel
Deitel & Associates, Inc.
Harvey Deitel
Deitel & Associates, Inc.
330 Hudson Street, NY, NY, 10013
Trademarks
Deitel and the double-thumbs-up bug are registered
trademarks of Deitel and Associates, Inc.
Oracle and Java are registered trademarks of Oracle and/or its
affiliates. Other names may be trademarks of their respective
owners.
Microsoft and/or its respective suppliers make no
representations about the suitability of the information
contained in the documents and related graphics published as
part of the services for any purpose. All such documents and
related graphics are provided “as is” without warranty of any
kind. Microsoft and/ or its respective suppliers hereby disclaim
all warranties and conditions with regard to this information,
including all warranties and conditions of merchantability,
whether express, implied or statutory, fitness for a particular
purpose, title and non-infringement. In no event shall
Microsoft and/or its respective suppliers be liable for any
special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
information available from the services.
The documents and related graphics contained herein could
include technical inaccuracies or typographical errors.
Changes are periodically added to the information herein.
Microsoft and/or its respective suppliers may make
improvements and/or changes in the product(s) and/or the
program(s) described herein at any time. Partial screen shots
may be viewed in full within the software version specified.
Microsoft and Windows are registered trademarks of the
Microsoft Corporation in the U.S.A. and other countries.
Screen shots and icons reprinted with permission from the
Microsoft Corporation. This book is not sponsored or endorsed
by or affiliated with the Microsoft Corporation.
UNIX is a registered trademark of The Open Group.
Apache is a trademark of The Apache Software Foundation.
CSS and XML are registered trademarks of the World Wide
Web Consortium.
Firefox is a registered trademark of the Mozilla Foundation.
Google is a trademark of Google, Inc.
Mac and macOS are trademarks of Apple Inc., registered in
the U.S. and other countries.
Linux is a registered trademark of Linus Torvalds. All
trademarks are property of their respective owners.
Throughout this book, trademarks are used. Rather than put a
trademark symbol in every occurrence of a trademarked name,
we state that we are using the names in an editorial fashion
® ®
only and to the benefit of the trademark owner, with no
intention of infringement of the trademark.
Contents
The online chapters and appendices listed at the end of this
Table of Contents are located on the book’s Companion
Website (http://www.pearsonhighered.com/
deitel/)—see the inside front cover of your book for
details.
1. Foreword xxv
2. Preface xxvii
3. Before You Begin xlvii
1. 1 Introduction to Computers, the Internet and Java 1
1. 1.1 Introduction 2
2. 1.2 Hardware and Software 4
1. 1.2.1 Moore’s Law 4
2. 1.2.2 Computer Organization 5
3. 1.3 Data Hierarchy 7
4. 1.4 Machine Languages, Assembly Languages and High-Level
Languages 9
5. 1.5 Introduction to Object Technology 10
1. 1.5.1 Automobile as an Object 11
2. 1.5.2 Methods and Classes 11
3. 1.5.3 Instantiation 11
4. 1.5.4 Reuse 11
5. 1.5.5 Messages and Methopd Calls 12
6. 1.5.6 Attributes and Instance Variables 12
7. 1.5.7 Encapsulation and Information Hiding 12
8. 1.5.8 Inheritance 12
9. 1.5.9 Interfaces 13
10. 1.5.10 Object-Oriented Analysis and Design (OOAD)
13
11. 1.5.11 The UML (Unified Modeling Language) 13
6. 1.6 Operating Systems 14
1. 1.6.1 Windows—A Proprietary Operating System 14
2. 1.6.2 Linux—An Open-Source Operating System 14
3. 1.6.3 Apple’s macOS and Apple’s iOS for iPhone ,
iPad and iPod Touch Devices 15
4. 1.6.4 Google’s Android 15
7. 1.7 Programming Languages 16
8. 1.8 Java 18
9. 1.9 A Typical Java Development Environment 19
10. 1.10 Test-Driving a Java Application 22
11. 1.11 Internet and World Wide Web 26
1. 1.11.1 Internet: A Network of Networks 27
2. 1.11.2 World Wide Web: Making the Internet User-
Friendly 27
3. 1.11.3 Web Services and Mashups 27
4. 1.11.4 Internet of Things 28
12. 1.12 Software Technologies 29
®
® ®
13. 1.13 Getting Your Questions Answered 31
2. 2 Introduction to Java Applications; Input/Output and Operators 35
1. 2.1 Introduction 36
2. 2.2 Your First Program in Java: Printing a Line of Text 36
1. 2.2.1 Compiling the Application 40
2. 2.2.2 Executing the Application 41
3. 2.3 Modifying Your First Java Program 42
4. 2.4 Displaying Text with printf 44
5. 2.5 Another Application: Adding Integers 45
1. 2.5.1 import Declarations 46
2. 2.5.2 Declaring and Creating a Scanner to Obtain
User Input from the Keyboard 46
3. 2.5.3 Prompting the User for Input 47
4. 2.5.4 Declaring a Variable to Store an Integer and
Obtaining an Integer from the Keyboard 47
5. 2.5.5 Obtaining a Second Integer 48
6. 2.5.6 Using Variables in a Calculation 48
7. 2.5.7 Displaying the Calculation Result 48
8. 2.5.8 Java API Documentation 49
9. 2.5.9 Declaring and Initializing Variables in Separate
Statements 49
6. 2.6 Memory Concepts 49
7. 2.7 Arithmetic 50
8. 2.8 Decision Making: Equality and Relational Operators 54
9. 2.9 Wrap-Up 57
3. 3 Introduction to Classes, Objects, Methods and Strings 68
1. 3.1 Introduction 69
2. 3.2 Instance Variables, set Methods and get Methods 70
1. 3.2.1 Account Class with an Instance Variable, and set
and get Methods 70
2. 3.2.2 AccountTest Class That Creates and Uses an
Object of Class Account 73
3. 3.2.3 Compiling and Executing an App with Multiple
Classes 76
4. 3.2.4 Account UML Class Diagram 76
5. 3.2.5 Additional Notes on Class AccountTest 78
6. 3.2.6 Software Engineering with private Instance
Variables and public set and get Methods 78
3. 3.3 Account Class: Initializing Objects with Constructors 79
1. 3.3.1 Declaring an Account Constructor for Custom
Object Initialization 80
2. 3.3.2 Class AccountTest: Initializing Account
Objects When They’re Created 81
4. 3.4 Account Class with a Balance; Floating-Point Numbers 82
1. 3.4.1 Account Class with a balance Instance
Variable of Type double 83
2. 3.4.2 AccountTest Class to Use Class Account 85
5. 3.5 Primitive Types vs. Reference Types 88
6. 3.6 (Optional) GUI and Graphics Case Study: A Simple GUI 88
1. 3.6.1 What Is a Graphical User Interface? 90
2. 3.6.2 JavaFX Scene Builder and FXML 90
3. 3.6.3 Welcome App—Displaying Text and an Image 90
4. 3.6.4 Opening Scene Builder and Creating the File
Welcome.fxml 90
5. 3.6.5 Adding an Image to the Folder Containing
Welcome.fxml 92
6. 3.6.6 Creating a VBox Layout Container 92
7. 3.6.7 Configuring the VBox 92
8. 3.6.8 Adding and Configuring a Label 92
9. 3.6.9 Adding and Configuring an ImageView 94
10. 3.6.10 Previewing the Welcome GUI 95
7. 3.7 Wrap-Up 96
4. 4 Control Statements: Part 1; Assignment, ++ and -- Operators 104
1. 4.1 Introduction 105
2. 4.2 Algorithms 105
3. 4.3 Pseudocode 106
4. 4.4 Control Structures 106
1. 4.4.1 Sequence Structure in Java 107
2. 4.4.2 Selection Statements in Java 108
3. 4.4.3 Iteration Statements in Java 108
4. 4.4.4 Summary of Control Statements in Java 108
5. 4.5 if Single-Selection Statement 109
6. 4.6 if…else Double-Selection Statement 110
1. 4.6.1 Nested if…else Statements 111
2. 4.6.2 Dangling-else Problem 112
3. 4.6.3 Blocks 112
4. 4.6.4 Conditional Operator (?:) 113
7. 4.7 Student Class: Nested if…else Statements 113
8. 4.8 while Iteration Statement 116
9. 4.9 Formulating Algorithms: Counter-Controlled Iteration 118
10. 4.10 Formulating Algorithms: Sentinel-Controlled Iteration 122
11. 4.11 Formulating Algorithms: Nested Control Statements 129
12. 4.12 Compound Assignment Operators 133
13. 4.13 Increment and Decrement Operators 134
14. 4.14 Primitive Types 137
15. 4.15 (Optional) GUI and Graphics Case Study: Event Handling;
Drawing Lines 138
1. 4.15.1 Test-Driving the Completed Draw Lines App
138
2. 4.15.2 Building the App’s GUI 139
3. 4.15.3 Preparing to Interact with the GUI
Programmatically 143
4. 4.15.4 Class DrawLinesController 145
5. 4.15.5 Class DrawLines—The Main Application
Class 147
16. 4.16 Wrap-Up 149
5. 5 Control Statements: Part 2; Logical Operators 164
1. 5.1 Introduction 165
2. 5.2 Essentials of Counter-Controlled Iteration 165
3. 5.3 for Iteration Statement 166
4. 5.4 Examples Using the for Statement 170
1. 5.4.1 Application: Summing the Even Integers from 2 to
20 171
2. 5.4.2 Application: Compound-Interest Calculations 172
5. 5.5 do…while Iteration Statement 175
6. 5.6 switch Multiple-Selection Statement 176
7. 5.7 Class AutoPolicy Case Study: Strings in switch
Statements 182
8. 5.8 break and continue Statements 185
1. 5.8.1 break Statement 185
2. 5.8.2 continue Statement 186
9. 5.9 Logical Operators 187
1. 5.9.1 Conditional AND (&&) Operator 187
2. 5.9.2 Conditional OR (||) Operator 188
3. 5.9.3 Short-Circuit Evaluation of Complex Conditions
189
4. 5.9.4 Boolean Logical AND (&) and Boolean Logical
Inclusive OR (|) Operators 189
5. 5.9.5 Boolean Logical Exclusive OR (^) 190
6. 5.9.6 Logical Negation (!) Operator 190
7. 5.9.7 Logical Operators Example 191
10. 5.10 Structured-Programming Summary 193
11. 5.11 (Optional) GUI and Graphics Case Study: Drawing
Rectangles and Ovals 198
12. 5.12 Wrap-Up 201
6. 6 Methods: A Deeper Look 212
1. 6.1 Introduction 213
2. 6.2 Program Units in Java 213
3. 6.3 static Methods, static Fields and Class Math 215
4. 6.4 Methods with Multiple Parameters 217
5. 6.5 Notes on Declaring and Using Methods 221
6. 6.6 Method-Call Stack and Activation Records 222
1. 6.6.1 Method-Call Stack 222
2. 6.6.2 Stack Frames 222
3. 6.6.3 Local Variables and Stack Frames 222
4. 6.6.4 Stack Overflow 223
7. 6.7 Argument Promotion and Casting 223
8. 6.8 Java API Packages 224
9. 6.9 Case Study: Secure Random-Number Generation 226
10. 6.10 Case Study: A Game of Chance; Introducing enum Types
231
11. 6.11 Scope of Declarations 236
12. 6.12 Method Overloading 238
1. 6.12.1 Declaring Overloaded Methods 238
2. 6.12.2 Distinguishing Between Overloaded Methods
239
3. 6.12.3 Return Types of Overloaded Methods 240
13. 6.13 (Optional) GUI and Graphics Case Study: Colors and Filled
Shapes 240
14. 6.14 Wrap-Up 243
7. 7 Arrays and ArrayLists 257
1. 7.1 Introduction 258
2. 7.2 Arrays 259
3. 7.3 Declaring and Creating Arrays 260
4. 7.4 Examples Using Arrays 262
1. 7.4.1 Creating and Initializing an Array 262
2. 7.4.2 Using an Array Initializer 263
3. 7.4.3 Calculating the Values to Store in an Array 264
4. 7.4.4 Summing the Elements of an Array 265
5. 7.4.5 Using Bar Charts to Display Array Data
Graphically 265
6. 7.4.6 Using the Elements of an Array as Counters 267
7. 7.4.7 Using Arrays to Analyze Survey Results 268
5. 7.5 Exception Handling: Processing the Incorrect Response 270
1. 7.5.1 The try Statement 270
2. 7.5.2 Executing the catch Block 270
3. 7.5.3 toString Method of the Exception Parameter
271
6. 7.6 Case Study: Card Shuffling and Dealing Simulation 271
7. 7.7 Enhanced for Statement 276
8. 7.8 Passing Arrays to Methods 277
9. 7.9 Pass-By-Value vs. Pass-By-Reference 279
10. 7.10 Case Study: Class GradeBook Using an Array to Store
Grades 280
11. 7.11 Multidimensional Arrays 285
1. 7.11.1 Arrays of One-Dimensional Arrays 286
2. 7.11.2 Two-Dimensional Arrays with Rows of Different
Lengths 286
3. 7.11.3 Creating Two-Dimensional Arrays with Array-
Creation Expressions 287
4. 7.11.4 Two-Dimensional Array Example: Displaying
Element Values 287
5. 7.11.5 Common Multidimensional-Array Manipulations
Performed with for Statements 288
12. 7.12 Case Study: Class GradeBook Using a Two-Dimensional
Array 289
13. 7.13 Variable-Length Argument Lists 295
14. 7.14 Using Command-Line Arguments 296
15. 7.15 Class Arrays 298
16. 7.16 Introduction to Collections and Class ArrayList 301
17. 7.17 (Optional) GUI and Graphics Case Study: Drawing Arcs
305
18. 7.18 Wrap-Up 308
8. 8 Classes and Objects: A Deeper Look 329
1. 8.1 Introduction 330
2. 8.2 Time Class Case Study 330
3. 8.3 Controlling Access to Members 335
4. 8.4 Referring to the Current Object’s Members with the this
Reference 336
5. 8.5 Time Class Case Study: Overloaded Constructors 338
6. 8.6 Default and No-Argument Constructors 343
7. 8.7 Notes on Set and Get Methods 344
8. 8.8 Composition 345
9. 8.9 enum Types 348
10. 8.10 Garbage Collection 351
11. 8.11 static Class Members 351
12. 8.12 static Import 355
13. 8.13 final Instance Variables 356
14. 8.14 Package Access 357
15. 8.15 Using BigDecimal for Precise Monetary Calculations 358
16. 8.16 (Optional) GUI and Graphics Case Study: Using Objects
with Graphics 361
17. 8.17 Wrap-Up 365
9. 9 Object-Oriented Programming: Inheritance 373
1. 9.1 Introduction 374
2. 9.2 Superclasses and Subclasses 375
3. 9.3 protected Members 377
4. 9.4 Relationship Between Superclasses and Subclasses 378
1. 9.4.1 Creating and Using a CommissionEmployee
Class 378
2. 9.4.2 Creating and Using a
BasePlusCommissionEmployee Class 383
3. 9.4.3 Creating a
CommissionEmployee–BasePlusCommissionEmployee
Inheritance Hierarchy 388
4. 9.4.4
CommissionEmployee–BasePlusCommissionEmployee
Inheritance Hierarchy Using protected Instance
Variables 391
5. 9.4.5
CommissionEmployee–BasePlusCommissionEmployee
Inheritance Hierarchy Using private Instance
Variables 394
5. 9.5 Constructors in Subclasses 398
6. 9.6 Class Object 399
7. 9.7 Designing with Composition vs. Inheritance 400
8. 9.8 Wrap-Up 402
10. 10 Object-Oriented Programming: Polymorphism and Interfaces 407
1. 10.1 Introduction 408
2. 10.2 Polymorphism Examples 410
3. 10.3 Demonstrating Polymorphic Behavior 411
4. 10.4 Abstract Classes and Methods 413
5. 10.5 Case Study: Payroll System Using Polymorphism 416
1. 10.5.1 Abstract Superclass Employee 417
2. 10.5.2 Concrete Subclass SalariedEmployee 419
3. 10.5.3 Concrete Subclass HourlyEmployee 421
4. 10.5.4 Concrete Subclass CommissionEmployee
422
5. 10.5.5 Indirect Concrete Subclass
BasePlusCommissionEmployee 424
6. 10.5.6 Polymorphic Processing, Operator
instanceof and Downcasting 425
6. 10.6 Allowed Assignments Between Superclass and Subclass
Variables 430
7. 10.7 final Methods and Classes 430
8. 10.8 A Deeper Explanation of Issues with Calling Methods from
Constructors 431
9. 10.9 Creating and Using Interfaces 432
1. 10.9.1 Developing a Payable Hierarchy 434
2. 10.9.2 Interface Payable 435
3. 10.9.3 Class Invoice 435
4. 10.9.4 Modifying Class Employee to Implement
Interface Payable 437
5. 10.9.5 Using Interface Payable to Process Invoices
and Employees Polymorphically 439
6. 10.9.6 Some Common Interfaces of the Java API 440
10. 10.10 Java SE 8 Interface Enhancements 441
1. 10.10.1 default Interface Methods 441
2. 10.10.2 static Interface Methods 442
3. 10.10.3 Functional Interfaces 442
11. 10.11 Java SE 9 private Interface Methods 443
12. 10.12 private Constructors 443
13. 10.13 Program to an Interface, Not an Implementation 444
1. 10.13.1 Implementation Inheritance Is Best for Small
Numbers of Tightly Coupled Classes 444
2. 10.13.2 Interface Inheritance Is Best for Flexibility 444
3. 10.13.3 Rethinking the Employee Hierarchy 445
14. 10.14 (Optional) GUI and Graphics Case Study: Drawing with
Polymorphism 446
15. 10.15 Wrap-Up 448
11. 11 Exception Handling: A Deeper Look 455
1. 11.1 Introduction 456
2. 11.2 Example: Divide by Zero without Exception Handling 457
3. 11.3 Example: Handling ArithmeticExceptions and
InputMismatchExceptions 459
4. 11.4 When to Use Exception Handling 465
5. 11.5 Java Exception Hierarchy 465
6. 11.6 finally Block 469
7. 11.7 Stack Unwinding and Obtaining Information from an
Exception 473
8. 11.8 Chained Exceptions 476
9. 11.9 Declaring New Exception Types 478
10. 11.10 Preconditions and Postconditions 479
11. 11.11 Assertions 479
12. 11.12 try-with-Resources: Automatic Resource Deallocation
481
13. 11.13 Wrap-Up 482
12. 12 JavaFX Graphical User Interfaces: Part 1 488
1. 12.1 Introduction 489
2. 12.2 JavaFX Scene Builder 490
3. 12.3 JavaFX App Window Structure 491
4. 12.4 Welcome App—Displaying Text and an Image 492
1. 12.4.1 Opening Scene Builder and Creating the File
Welcome.fxml 492
2. 12.4.2 Adding an Image to the Folder Containing
Welcome.fxml 493
3. 12.4.3 Creating a VBox Layout Container 493
4. 12.4.4 Configuring the VBox Layout Container 494
5. 12.4.5 Adding and Configuring a Label 494
6. 12.4.6 Adding and Configuring an ImageView 495
7. 12.4.7 Previewing the Welcome GUI 497
5. 12.5 Tip Calculator App—Introduction to Event Handling 497
1. 12.5.1 Test-Driving the Tip Calculator App 498
2. 12.5.2 Technologies Overview 499
3. 12.5.3 Building the App’s GUI 501
4. 12.5.4 TipCalculator Class 508
5. 12.5.5 TipCalculatorController Class 510
6. 12.6 Features Covered in the Other JavaFX Chapters 515
7. 12.7 Wrap-Up 515
13. 13 JavaFX GUI: Part 2 523
1. 13.1 Introduction 524
2. 13.2 Laying Out Nodes in a Scene Graph 524
3. 13.3 Painter App: RadioButtons, Mouse Events and Shapes
526
1. 13.3.1 Technologies Overview 526
2. 13.3.2 Creating the Painter.fxml File 528
3. 13.3.3 Building the GUI 528
4. 13.3.4 Painter Subclass of Application 531
5. 13.3.5 PainterController Class 532
4. 13.4 Color Chooser App: Property Bindings and Property
Listeners 536
1. 13.4.1 Technologies Overview 536
2. 13.4.2 Building the GUI 537
3. 13.4.3 ColorChooser Subclass of Application
539
4. 13.4.4 ColorChooserController Class 540
5. 13.5 Cover Viewer App: Data-Driven GUIs with JavaFX
Collections 542
1. 13.5.1 Technologies Overview 543
2. 13.5.2 Adding Images to the App’s Folder 543
3. 13.5.3 Building the GUI 543
4. 13.5.4 CoverViewer Subclass of Application 545
5. 13.5.5 CoverViewerController Class 545
6. 13.6 Cover Viewer App: Customizing ListView Cells 547
1. 13.6.1 Technologies Overview 548
2. 13.6.2 Copying the CoverViewer App 548
3. 13.6.3 ImageTextCell Custom Cell Factory Class
549
4. 13.6.4 CoverViewerController Class 550
7. 13.7 Additional JavaFX Capabilities 551
8. 13.8 JavaFX 9: Java SE 9 JavaFX Updates 553
9. 13.9 Wrap-Up 555
14. 14 Strings, Characters and Regular Expressions 564
1. 14.1 Introduction 565
2. 14.2 Fundamentals of Characters and Strings 565
3. 14.3 Class String 566
1. 14.3.1 String Constructors 566
2. 14.3.2 String Methods length, charAt and
getChars 567
3. 14.3.3 Comparing Strings 569
4. 14.3.4 Locating Characters and Substrings in Strings
573
5. 14.3.5 Extracting Substrings from Strings 575
6. 14.3.6 Concatenating Strings 576
7. 14.3.7 Miscellaneous String Methods 577
8. 14.3.8 String Method valueOf 578
4. 14.4 Class StringBuilder 579
1. 14.4.1 StringBuilder Constructors 580
2. 14.4.2 StringBuilder Methods length,
capacity, setLength and ensureCapacity
581
3. 14.4.3 StringBuilder Methods charAt,
setCharAt, getChars and reverse 582
4. 14.4.4 StringBuilder append Methods 583
5. 14.4.5 StringBuilder Insertion and Deletion
Methods 585
5. 14.5 Class Character 586
6. 14.6 Tokenizing Strings 591
7. 14.7 Regular Expressions, Class Pattern and Class Matcher
592
1. 14.7.1 Replacing Substrings and Splitting Strings 597
2. 14.7.2 Classes Pattern and Matcher 599
8. 14.8 Wrap-Up 601
15. 15 Files, Input/Output Streams, NIO and XML Serialization 612
1. 15.1 Introduction 613
2. 15.2 Files and Streams 613
3. 15.3 Using NIO Classes and Interfaces to Get File and Directory
Information 615
4. 15.4 Sequential Text Files 619
1. 15.4.1 Creating a Sequential Text File 619
2. 15.4.2 Reading Data from a Sequential Text File 622
3. 15.4.3 Case Study: A Credit-Inquiry Program 623
4. 15.4.4 Updating Sequential Files 628
5. 15.5 XML Serialization 628
1. 15.5.1 Creating a Sequential File Using XML
Serialization 628
2. 15.5.2 Reading and Deserializing Data from a
Sequential File 634
6. 15.6 FileChooser and DirectoryChooser Dialogs 635
7. 15.7 (Optional) Additional java.io Classes 641
1. 15.7.1 Interfaces and Classes for Byte-Based Input and
Output 641
2. 15.7.2 Interfaces and Classes for Character-Based Input
and Output 643
8. 15.8 Wrap-Up 644
16. 16 Generic Collections 652
1. 16.1 Introduction 653
2. 16.2 Collections Overview 653
3. 16.3 Type-Wrapper Classes 655
4. 16.4 Autoboxing and Auto-Unboxing 655
5. 16.5 Interface Collection and Class Collections 655
6. 16.6 Lists 656
1. 16.6.1 ArrayList and Iterator 657
2. 16.6.2 LinkedList 659
7. 16.7 Collections Methods 664
1. 16.7.1 Method sort 664
2. 16.7.2 Method shuffle 668
3. 16.7.3 Methods reverse, fill, copy, max and min
670
4. 16.7.4 Method binarySearch 672
5. 16.7.5 Methods addAll, frequency and
disjoint 673
8. 16.8 Class PriorityQueue and Interface Queue 675
9. 16.9 Sets 676
10. 16.10 Maps 679
11. 16.11 Synchronized Collections 683
12. 16.12 Unmodifiable Collections 683
13. 16.13 Abstract Implementations 684
14. 16.14 Java SE 9: Convenience Factory Methods for Immutable
Collections 684
15. 16.15 Wrap-Up 688
17. 17 Lambdas and Streams 694
1. 17.1 Introduction 695
2. 17.2 Streams and Reduction 697
1. 17.2.1 Summing the Integers from 1 through 10 with a
for Loop 697
2. 17.2.2 External Iteration with for Is Error Prone 698
3. 17.2.3 Summing with a Stream and Reduction 698
4. 17.2.4 Internal Iteration 699
3. 17.3 Mapping and Lambdas 700
1. 17.3.1 Lambda Expressions 701
2. 17.3.2 Lambda Syntax 702
3. 17.3.3 Intermediate and Terminal Operations 703
4. 17.4 Filtering 704
5. 17.5 How Elements Move Through Stream Pipelines 706
6. 17.6 Method References 707
1. 17.6.1 Creating an IntStream of Random Values 708
2. 17.6.2 Performing a Task on Each Stream Element with
forEach and a Method Reference 708
3. 17.6.3 Mapping Integers to String Objects with
mapToObj 709
4. 17.6.4 Concatenating Strings with collect 709
7. 17.7 IntStream Operations 710
1. 17.7.1 Creating an IntStream and Displaying Its
Values 711
2. 17.7.2 Terminal Operations count, min, max, sum
and average 711
3. 17.7.3 Terminal Operation reduce 712
4. 17.7.4 Sorting IntStream Values 714
8. 17.8 Functional Interfaces 715
9. 17.9 Lambdas: A Deeper Look 716
10. 17.10 Stream<Integer> Manipulations 717
1. 17.10.1 Creating a Stream<Integer> 718
2. 17.10.2 Sorting a Stream and Collecting the Results
719
3. 17.10.3 Filtering a Stream and Storing the Results for
Later Use 719
4. 17.10.4 Filtering and Sorting a Stream and Collecting
the Results 720
5. 17.10.5 Sorting Previously Collected Results 720
11. 17.11 Stream<String> Manipulations 720
1. 17.11.1 Mapping Strings to Uppercase 721
2. 17.11.2 Filtering Strings Then Sorting Them in Case-
Insensitive Ascending Order 722
3. 17.11.3 Filtering Strings Then Sorting Them in Case-
Insensitive Descending Order 722
12. 17.12 Stream<Employee> Manipulations 723
1. 17.12.1 Creating and Displaying a List<Employee>
724
2. 17.12.2 Filtering Employees with Salaries in a
Specified Range 725
3. 17.12.3 Sorting Employees By Multiple Fields 728
4. 17.12.4 Mapping Employees to Unique-Last-Name
Strings 730
5. 17.12.5 Grouping Employees By Department 731
6. 17.12.6 Counting the Number of Employees in Each
Department 732
7. 17.12.7 Summing and Averaging Employee Salaries
733
13. 17.13 Creating a Stream<String> from a File 734
14. 17.14 Streams of Random Values 737
15. 17.15 Infinite Streams 739
16. 17.16 Lambda Event Handlers 741
17. 17.17 Additional Notes on Java SE 8 Interfaces 741
18. 17.18 Wrap-Up 742
18. 18 Recursion 756
1. 18.1 Introduction 757
2. 18.2 Recursion Concepts 758
3. 18.3 Example Using Recursion: Factorials 759
4. 18.4 Reimplementing Class FactorialCalculator Using
BigInteger 761
5. 18.5 Example Using Recursion: Fibonacci Series 763
6. 18.6 Recursion and the Method-Call Stack 766
7. 18.7 Recursion vs. Iteration 767
8. 18.8 Towers of Hanoi 769
9. 18.9 Fractals 771
1. 18.9.1 Koch Curve Fractal 772
2. 18.9.2 (Optional) Case Study: Lo Feather Fractal 773
3. 18.9.3 (Optional) Fractal App GUI 775
4. 18.9.4 (Optional) FractalController Class 777
10. 18.10 Recursive Backtracking 782
11. 18.11 Wrap-Up 782
19. 19 Searching, Sorting and Big O 791
1. 19.1 Introduction 792
2. 19.2 Linear Search 793
3. 19.3 Big O Notation 796
1. 19.3.1 O(1) Algorithms 796
2. 19.3.2 O(n) Algorithms 796
3. 19.3.3 O(n ) Algorithms 796
4. 19.3.4 Big O of the Linear Search 797
4. 19.4 Binary Search 797
1. 19.4.1 Binary Search Implementation 798
2. 19.4.2 Efficiency of the Binary Search 801
5. 19.5 Sorting Algorithms 802
6. 19.6 Selection Sort 802
1. 19.6.1 Selection Sort Implementation 803
2. 19.6.2 Efficiency of the Selection Sort 805
7. 19.7 Insertion Sort 805
1. 19.7.1 Insertion Sort Implementation 806
2. 19.7.2 Efficiency of the Insertion Sort 808
8. 19.8 Merge Sort 809
1. 19.8.1 Merge Sort Implementation 809
2. 19.8.2 Efficiency of the Merge Sort 814
9. 19.9 Big O Summary for This Chapter’s Searching and Sorting
Algorithms 814
10. 19.10 Massive Parallelism and Parallel Algorithms 815
2
11. 19.11 Wrap-Up 815
20. 20 Generic Classes and Methods: A Deeper Look 821
1. 20.1 Introduction 822
2. 20.2 Motivation for Generic Methods 822
3. 20.3 Generic Methods: Implementation and Compile-Time
Translation 824
4. 20.4 Additional Compile-Time Translation Issues: Methods That
Use a Type Parameter as the Return Type 827
5. 20.5 Overloading Generic Methods 830
6. 20.6 Generic Classes 831
7. 20.7 Wildcards in Methods That Accept Type Parameters 838
8. 20.8 Wrap-Up 842
21. 21 Custom Generic Data Structures 846
1. 21.1 Introduction 847
2. 21.2 Self-Referential Classes 848
3. 21.3 Dynamic Memory Allocation 848
4. 21.4 Linked Lists 849
1. 21.4.1 Singly Linked Lists 849
2. 21.4.2 Implementing a Generic List Class 850
3. 21.4.3 Generic Classes ListNode and List 853
4. 21.4.4 Class ListTest 853
5. 21.4.5 List Method insertAtFront 855
6. 21.4.6 List Method insertAtBack 856
7. 21.4.7 List Method removeFromFront 856
8. 21.4.8 List Method removeFromBack 857
9. 21.4.9 List Method print 858
10. 21.4.10 Creating Your Own Packages 858
5. 21.5 Stacks 863
6. 21.6 Queues 866
7. 21.7 Trees 868
8. 21.8 Wrap-Up 875
22. 22 JavaFX Graphics and Multimedia 900
1. 22.1 Introduction 901
2. 22.2 Controlling Fonts with Cascading Style Sheets (CSS) 902
1. 22.2.1 CSS That Styles the GUI 902
2. 22.2.2 FXML That Defines the GUI—Introduction to
XML Markup 905
3. 22.2.3 Referencing the CSS File from FXML 908
4. 22.2.4 Specifying the VBox’s Style Class 908
5. 22.2.5 Programmatically Loading CSS 908
3. 22.3 Displaying Two-Dimensional Shapes 909
1. 22.3.1 Defining Two-Dimensional Shapes with FXML
909
2. 22.3.2 CSS That Styles the Two-Dimensional Shapes
912
4. 22.4 Polylines, Polygons and Paths 914
1. 22.4.1 GUI and CSS 915
2. 22.4.2 PolyShapesController Class 916
5. 22.5 Transforms 919
6. 22.6 Playing Video with Media, MediaPlayer and
MediaViewer 921
1. 22.6.1 VideoPlayer GUI 922
2. 22.6.2 VideoPlayerController Class 924
7. 22.7 Transition Animations 928
1. 22.7.1 TransitionAnimations.fxml 928
2. 22.7.2 TransitionAnimationsController
Class 930
8. 22.8 Timeline Animations 934
9. 22.9 Frame-by-Frame Animation with AnimationTimer 937
10. 22.10 Drawing on a Canvas 939
11. 22.11 Three-Dimensional Shapes 944
12. 22.12 Wrap-Up 947
23. 23 Concurrency 963
1. 23.1 Introduction 964
2. 23.2 Thread States and Life Cycle 966
1. 23.2.1 New and Runnable States 967
2. 23.2.2 Waiting State 967
3. 23.2.3 Timed Waiting State 967
4. 23.2.4 Blocked State 967
5. 23.2.5 Terminated State 967
6. 23.2.6 Operating-System View of the Runnable State
968
7. 23.2.7 Thread Priorities and Thread Scheduling 968
8. 23.2.8 Indefinite Postponement and Deadlock 969
3. 23.3 Creating and Executing Threads with the Executor
Framework 969
4. 23.4 Thread Synchronization 973
1. 23.4.1 Immutable Data 974
2. 23.4.2 Monitors 974
3. 23.4.3 Unsynchronized Mutable Data Sharing 975
4. 23.4.4 Synchronized Mutable Data Sharing—Making
Operations Atomic 979
5. 23.5 Producer/Consumer Relationship without Synchronization
982
6. 23.6 Producer/Consumer Relationship:
ArrayBlockingQueue 990
7. 23.7 (Advanced) Producer/Consumer Relationship with
synchronized, wait, notify and notifyAll 993
8. 23.8 (Advanced) Producer/Consumer Relationship: Bounded
Buffers 999
9. 23.9 (Advanced) Producer/Consumer Relationship: The Lock
and Condition Interfaces 1007
10. 23.10 Concurrent Collections 1014
11. 23.11 Multithreading in JavaFX 1016
1. 23.11.1 Performing Computations in a Worker Thread:
Fibonacci Numbers 1017
2. 23.11.2 Processing Intermediate Results: Sieve of
Eratosthenes 1022
12. 23.12 sort/parallelSort Timings with the Java SE 8
Date/Time API 1028
13. 23.13 Java SE 8: Sequential vs. Parallel Streams 1031
14. 23.14 (Advanced) Interfaces Callable and Future 1033
15. 23.15 (Advanced) Fork/Join Framework 1038
16. 23.16 Wrap-Up 1038
24. 24 Accessing Databases with JDBC 1050
1. 24.1 Introduction 1051
2. 24.2 Relational Databases 1052
3. 24.3 A books Database 1053
4. 24.4 SQL 1057
1. 24.4.1 Basic SELECT Query 1058
2. 24.4.2 WHERE Clause 1058
3. 24.4.3 ORDER BY Clause 1060
5. 24.4.4 Merging Data from Multiple Tables: INNER JOIN 1062
1. 24.4.5 INSERT Statement 1063
2. 24.4.6 UPDATE Statement 1064
3. 24.4.7 DELETE Statement 1065
6. 24.5 Setting Up a Java DB Database 1066
1. 24.5.1 Creating the Chapter’s Databases on Windows
1067
2. 24.5.2 Creating the Chapter’s Databases on macOS
1068
3. 24.5.3 Creating the Chapter’s Databases on Linux 1068
7. 24.6 Connecting to and Querying a Database 1068
1. 24.6.1 Automatic Driver Discovery 1070
2. 24.6.2 Connecting to the Database 1070
3. 24.6.3 Creating a Statement for Executing Queries
1071
4. 24.6.4 Executing a Query 1071
5. 24.6.5 Processing a Query’s ResultSet 1072
8. 24.7 Querying the books Database 1073
1. 24.7.1 ResultSetTableModel Class 1073
2. 24.7.2 DisplayQueryResults App’s GUI 1080
3. 24.7.3 DisplayQueryResultsController Class
1080
9. 24.8 RowSet Interface 1085
10. 24.9 PreparedStatements 1088
1. 24.9.1 AddressBook App That Uses
PreparedStatements 1089
2. 24.9.2 Class Person 1089
3. 24.9.3 Class PersonQueries 1091
4. 24.9.4 AddressBook GUI 1094
5. 24.9.5 Class AddressBookController 1095
11. 24.10 Stored Procedures 1100
12. 24.11 Transaction Processing 1100
13. 24.12 Wrap-Up 1101
25. 25 Introduction to JShell: Java 9’s REPL 1109
1. 25.1 Introduction 1110
2. 25.2 Installing JDK 9 1112
3. 25.3 Introduction to JShell 1112
1. 25.3.1 Starting a JShell Session 1113
2. 25.3.2 Executing Statements 1113
3. 25.3.3 Declaring Variables Explicitly 1114
4. 25.3.4 Listing and Executing Prior Snippets 1116
5. 25.3.5 Evaluating Expressions and Declaring Variables
Implicitly 1118
6. 25.3.6 Using Implicitly Declared Variables 1118
7. 25.3.7 Viewing a Variable’s Value 1119
8. 25.3.8 Resetting a JShell Session 1119
9. 25.3.9 Writing Multiline Statements 1119
10. 25.3.10 Editing Code Snippets 1120
11. 25.3.11 Exiting JShell 1123
4. 25.4 Command-Line Input in JShell 1123
5. 25.5 Declaring and Using Classes 1124
1. 25.5.1 Creating a Class in JShell 1125
2. 25.5.2 Explicitly Declaring Reference-Type Variables
1125
3. 25.5.3 Creating Objects 1126
4. 25.5.4 Manipulating Objects 1126
5. 25.5.5 Creating a Meaningful Variable Name for an
Expression 1127
6. 25.5.6 Saving and Opening Code-Snippet Files 1128
6. 25.6 Discovery with JShell Auto-Completion 1128
1. 25.6.1 Auto-Completing Identifiers 1129
2. 25.6.2 Auto-Completing JShell Commands 1130
7. 25.7 Exploring a Class’s Members and Viewing Documentation
1130
1. 25.7.1 Listing Class Math’s static Members 1131
2. 25.7.2 Viewing a Method’s Parameters 1131
3. 25.7.3 Viewing a Method’s Documentation 1132
4. 25.7.4 Viewing a public Field’s Documentation 1132
5. 25.7.5 Viewing a Class’s Documentation 1133
6. 25.7.6 Viewing Method Overloads 1133
7. 25.7.7 Exploring Members of a Specific Object 1134
8. 25.8 Declaring Methods 1136
1. 25.8.1 Forward Referencing an Undeclared Method—
Declaring Method displayCubes 1136
2. 25.8.2 Declaring a Previously Undeclared Method 1136
3. 25.8.3 Testing cube and Replacing Its Declaration
1137
4. 25.8.4 Testing Updated Method cube and Method
displayCubes 1137
9. 25.9 Exceptions 1138
10. 25.10 Importing Classes and Adding Packages to the
CLASSPATH 1139
11. 25.11 Using an External Editor 1141
12. 25.12 Summary of JShell Commands 1143
1. 25.12.1 Getting Help in JShell 1144
2. 25.12.2 /edit Command: Additional Features 1145
3. 25.12.3 /reload Command 1145
4. 25.12.4 /drop Command 1146
5. 25.12.5 Feedback Modes 1146
6. 25.12.6 Other JShell Features Configurable with /set
1148
13. 25.13 Keyboard Shortcuts for Snippet Editing 1149
14. 25.14 How JShell Reinterprets Java for Interactive Use 1149
15. 25.15 IDE JShell Support 1150
16. 25.16 Wrap-Up 1150
1. Chapters on the Web 1166
2. A Operator Precedence Chart 1167
3. B ASCII Character Set 1169
4. C Keywords and Reserved Words 1170
5. D Primitive Types 1171
6. E Using the Debugger 1172
1. E.1 Introduction 1173
2. E.2 Breakpoints and the run, stop, cont and print
Commands 1173
3. E.3 The print and set Commands 1177
4. E.4 Controlling Execution Using the step, step up and next
Commands 1179
5. E.5 The watch Command 1181
6. E.6 The clear Command 1183
7. E.7 Wrap-Up 1186
7. Appendices on the Web 1187
8. Index 1189
1. Online Chapters and Appendices
The online chapters and appendices are located on the book’s
Companion Website. See the book’s inside front cover for details.
2. 26 Swing GUI Components: Part 1
3. 27 Graphics and Java 2D
4. 28 Networking
5. 29 Java Persistence API (JPA)
6. 30 JavaServer™ Faces Web Apps: Part 1
7. 31 JavaServer™ Faces Web Apps: Part 2
8. 32 REST-Based Web Services
9. 33 (Optional) ATM Case Study, Part 1: Object-Oriented Design with the
UML
10. 34 (Optional) ATM Case Study, Part 2: Implementing an Object-Oriented
Design
11. 35 Swing GUI Components: Part 2
12. 36 Java Module System and Other Java 9 Features
13. F Using the Java API Documentation
14. G Creating Documentation with javadoc
15. H Unicode®
16. I Formatted Output
17. J Number Systems
18. K Bit Manipulation
19. L Labeled break and continue Statements
20. M UML 2: Additional Diagram Types
21. N Design Patterns
Foreword
Throughout my career I’ve met and interviewed many expert
Java developers who’ve learned from Paul and Harvey,
through one or more of their college textbooks, professional
books, videos and corporate training. Many Java User Groups
have joined together around the Deitels’ publications, which
are used internationally in university courses and professional
training programs. You are joining an elite group.
How do I become an expert
Java developer?
This is one of the most common questions I receive at talks for
university students and at events with Java professionals.
Students want to become expert developers—and this is a
great time to be one.
The market is wide open, full of opportunities and fascinating
projects, especially for those who take the time to learn,
practice and master software development. The world needs
good, focused expert developers.
So, how do you do it? First, let’s be clear: Software
development is hard. But do not be discouraged. Mastering it
opens the door to great opportunities. Accept that it’s hard,
embrace the complexity, enjoy the ride. There are no limits to
how much you can expand your skills.
Software development is an amazing skill. It can take you
anywhere. You can work in any field. From nonprofits making
the world a better place, to bleeding-edge biological
technologies. From the frenetic daily run of the financial world
to the deep mysteries of religion. From sports to music to
acting. Everything has software. The success or failure of
initiatives everywhere will depend on developers’ knowledge
and skills.
The push for you to get the relevant skills is what makes Java
How to Program, 11/e so compelling. Written for students and
new developers, it’s easy to follow. It’s written by authors who
are educators and developers, with input over the years from
some of the world’s leading academics and professional Java
experts—Java Champions, open-source Java developers, even
creators of Java itself. Their collective knowledge and
experience will guide you. Even seasoned Java professionals
will learn and grow their expertise with the wisdom in these
pages.
How can this book help you
become an expert?
Java was released in 1995—Paul and Harvey had the first
edition of Java How to Program ready for Fall 1996 classes.
Since that groundbreaking book, they’ve produced ten more
editions, keeping current with the latest developments and
idioms in the Java software-engineering community. You hold
in your hands the map that will enable you to rapidly develop
your Java skills.
The Deitels have broken down the humongous Java world into
well-defined, specific goals. Put in your full attention, and
consciously “beat” each chapter. You’ll soon find yourself
moving nicely along your road to excellence. And with both
Java 8 and Java 9 in the same book, you’ll have up-to-date
skills on the latest Java technologies.
Most importantly, this book is not just meant for you to read—
it’s meant for you to practice. Be it in the classroom or at
home after work, experiment with the abundant sample code
and practice with the book’s extraordinarily rich and diverse
collection of exercises. Take the time to do all that is in here
and you’ll be well on your way to achieving a level of
expertise that will challenge professional developers out there.
After working with Java for more than 20 years, I can tell you
that this is not an exaggeration.
For example, one of my favorite chapters is Lambdas and
Streams. The chapter covers the topic in detail and the
exercises shine—many real-world challenges that developers
will encounter every day and that will help you sharpen your
skills. After solving these exercises, novices and experienced
developers alike will deeply understand these important Java
features. And if you have a question, don’t be shy—the Deitels
publish their email address in every book they write to
encourage interaction.
That’s also why I love the chapter about JShell—the new Java
9 tool that enables interactive Java. JShell allows you to
explore, discover and experiment with new concepts, language
features and APIs, make mistakes—accidentally and
intentionally—and correct them, and rapidly prototype new
code. It may prove to be the most important tool for leveraging
your learning and productivity. Paul and Harvey give a full
treatment of JShell that both students and experienced
developers will be able to put to use immediately.
I’m impressed with the care that the Deitels always take care
to accommodate readers at all levels. They ease you into
difficult concepts and deal with the challenges that
professionals will encounter in industry projects.
There’s lots of information about Java 9, the important new
Java release. You can jump right in and learn the latest Java
features. If you’re still working with Java 8, you can ease into
Java 9 at your own pace—be sure to begin with the
extraordinary JShell coverage.
Another example is the amazing coverage of JavaFX—Java’s
latest GUI, graphics and multimedia capabilities. JavaFX is
the recommended toolkit for new projects. But if you’ll be
working on legacy projects that use the older Swing API, those
chapters are still available to you.
Make sure to dig in on Paul and Harvey’s treatment of
concurrency. They explain the basic concepts so clearly that
the intermediate and advanced examples and discussions will
be easy to master. You will be ready to maximize your
applications’ performance in an increasingly multi-core world.
I encourage you to participate in the worldwide Java
community. There are many helpful folks out there who stand
ready to help you. Ask questions, get answers and answer your
peers’ questions. Along with this book, the Internet and the
academic and professional communities will help speed you
on your way to becoming an expert Java developer. I wish you
success!
Bruno Sousa
bruno@javaman.com.br
Java Champion
Java Specialist at ToolsCloud
President of SouJava (the Brazilian Java Society)
SouJava representative at the Java Community Process
Exploring the Variety of Random
Documents with Different Content
regard have been conservative and therefore would not result in overestimates. The
number of houses per village can sometimes be calculated rather closely from the
number of house pits seen in the sites. That is, the houses can be calculated closely if
the assumption is correct that four-fifths of the number of house pits in a site represents
the number of simultaneously occupied houses. Admittedly, this figure is rather
speculative, but the best opinions I have been able to get grant that it is probably
conservative.
A more serious possible source of error concerns the question of which and how many
sites were simultaneously occupied. When there is a complete village count, I have
excluded from consideration known summer villages, villages not on main salmon
streams, and other villages of doubtful status. Even so, the villages run about one per
mile along the salmon streams and the possibility presents itself of movement from site
to site, perhaps in response to varying fishing conditions. If this was the practice, then
the population estimates might have to be reduced by half or even more. But there is no
concrete evidence to support such a theory and it is a fact that the Goddard material
gives quite complete information of this kind. Therefore, if the present calculation is an
overestimate, it is not a very great one.
ESTIMATES BASED ON VILLAGE COUNTS
Wailaki (Eel and North Fork).—The present list gives a total of 67 villages among the Eel
River and North Fork Wailaki. For purposes of calculating population I have excluded 13
of them (nos. 6, 9, 16, 31, 38, 40, 51, 57, 58, 59, 61, 66, 67) because they are summer
camps in the hills, rock shelters used only briefly, or specialized fish-drying camps. These
places do not seem to have been used simultaneously with the main villages. This list
appears to be a substantially complete count from Horseshoe Bend south, but it is clear
that neither Merriam nor Goddard visited the area north of this, and the village count
suffers as a result. There are about 16 river-miles south of Horseshoe Bend, including
both the main Eel and North Fork, and there are 49 main villages on this stretch, yielding
an average of 3.1 per river-mile. If we apply this figure to the 7 river-miles above
Horseshoe Bend, we get 21.7 villages for that stretch rather than 5, as given by
ethnographers. We may reduce this figure to 15, because this stretch of the river appears
to offer a less desirable location (Goddard, 1923a, p. 107).
This calculation gives a total of 69 villages for the entire group, considerably less than
Cook's total of 87 (Cook, 1956, p. 104). The reason for the difference is that Cook bases
his estimate on Goddard's data, with the territory of the Wailaki extending above
Kekawaka Creek, whereas I have taken Kekawaka Creek as the boundary.
The house count per site for this group must be extrapolated from Goddard's house-pit
counts (1923a, pp. 103, 105) on the sites of two of the tribelets. This figure has been
calculated by Cook, who takes Goddard's house-pit count for 20 sites as "92 pits." For
two localities, however, Goddard specifies a certain number plus "several" others. "If we
allow 4 to represent 'several,' in each of these, then the total number of pits is 100 and
the average per site or village is 5.0" (Cook, 1956, p. 104). Cook then reduces the figure
by 20 per cent to allow for the probability that not all the house pits represent
simultaneously occupied houses. His average number of houses per site is 4, which would
not appear to be an overestimate. If we take this figure, we have a total of 276 houses
for the Wailaki as against Cook's figure of 348, which was based on a greater area.
Cook takes 6 persons per house as the average density for the Wailaki. This figure is
arrived at in several ways. The figure of 7.5 per house is well established for the Yurok
and sets an upper limit for the Wailaki area. Goddard appears to have based his
population estimate on a mean of 4.5 persons per house, almost certainly too low, and
Cook compromised at 6 per house. This figure is supported by independent observation
by Foster on the Round Valley Yuki (Cook, 1956, p. 107). The social organization and the
habitat of the Yuki and Wailaki are nearly identical, so the population per house should be
the same for both groups.
Accepting the figure of 6 persons per house, we get a total population of 1,656 for the
Eel Wailaki and the North Fork Wailaki, as compared with Cook's figure of 2,315 and
Goddard's figure of between one and two thousand.
Pitch Wailaki.—Goddard (1924) records 33 villages for the Pitch Wailaki. For two of the
four tribelets, the count is virtually complete. For a third tribelet, the T'odannañkiyahañ,
Goddard lists 6 villages and indicates that there were probably more (1924, p. 225). If, to
allow for these possible villages, we add 5 to the total above, we get a total of 38 villages
for three tribelets, or an average of 12.7 per tribelet. Although the fourth tribelet, the
Tchokotkiyahañ, had a poorer habitat than the other three (Goddard, 1924, p. 222), we
may assume that it had at least 8 villages, an estimate which is probably conservative in
view of its extensive territory. We then get a total of 46 villages for the Pitch Wailaki.
Goddard counted house pits in 22 village sites and got an average of 5 per site. If we
reduce this to 4 to account for unoccupied pits, we have an estimate of 184 houses for
the Pitch Wailaki, as against 172 estimated by Cook. On the basis of 6 persons per house
this gives a population of 1,104 as against 1,032 by Cook and between 650 and 800 by
Goddard.
For all Wailaki combined we get a total of 2,760. Cook's figure is 3,350, Kroeber's is
1,000, and Goddard's is between 1,650 and 2,800—average of 2,225. The difference
between the figure presented here and Cook's figure is mostly due to the adjustment I
have made in the Wailaki boundary from the one used by Goddard.
Mattole.—The village lists of Merriam and Goddard give a total of 42 villages for the
Mattole. I have excluded 5 of these from calculation of population estimates, one
because it is a summer camp and four others because the frequency appears too great,
in places along the coast, to make simultaneous occupation likely. This leaves a total of
37, very likely a conservative estimate since Goddard gives a number of names of villages
not located and therefore not included in our calculations.
Cook estimates 6 houses per village for the Mattole on the basis of comparison with the
Wiyot, Yurok, Tolowa, and Chilula. Goddard counted house pits for a few sites of the
Mattole and they appear to average less than that. Not much reliance can be placed on
this average, because the sample was very small. However, the number of houses per
site is probably not as high as among the Yurok. I have compromised with a figure of 5.4,
the same as the estimate for the Sinkyone, the eastern neighbors of the Mattole.
Cook takes Kroeber's Yurok figure of 7.5 persons per house in calculating Mattole
population. The social organization here is more nearly like that of the southern
Athabascans, so I have used 6 per house. This figure gives a total population of 1,200 as
against 840 figured by Cook for the Mattole exclusive of Bear River. The difference here is
due to the fact that Goddard's village lists were not available to Cook. If they had been,
he would have obtained a figure of 1,665, or nearly double his actual estimate.
Lolangkok Sinkyone.—For the Sinkyone on the northern part of the South Fork of the Eel
we have a nearly complete village count. South of Larabee Creek Goddard and Merriam
give a total of 46 villages. North of Larabee Creek on the main Eel the village count is
incomplete, but Merriam gives 8 place names. That these place names represent village
names is clear from the Merriam place names farther south which can be checked against
Goddard's data. Together, these give a total of 54 villages but leave out the areas of Bull
Creek and the upper Mattole River. We may assume 5 villages in each of these, surely a
conservative estimate in view of the density of sites on Salmon Creek and South Fork. We
thus have an estimate of 64 villages for the Northern Sinkyone.
Goddard counted house pits in 24 of the sites he recorded. They come to a total of 162
or 6.7 per village. If we reduce this by 20 per cent to account for unoccupied pits, we get
an average of 5.4 houses per site or a total estimate of 346 houses among the Lolangkok
Sinkyone. At 6 persons per house this estimate yields a total population of 2,076.
Hupa.—In the present village list there are 11 villages in Hoopa Valley and 16 above the
valley on the main Trinity and on South Fork. Of these sixteen, three have been rejected
as being in Chimariko territory (nos. 25, 26, 27). Cook has argued, reasonably, it appears,
that the villages in Hoopa Valley average 11 houses, whereas the villages above the
valley average 4.5 houses each. This average gives a total of 193 houses for the Hupa.
Cook has estimated that there is an average of 10 persons per house among the Hupa.
This figure is arrived at by the following line of reasoning: according to a census taken in
1870 there was a total of 601 persons in 7 villages at that time, of which 232 were male
and 359 were female. This count indicates a disproportionate number of males and Cook
therefore calculates a population of twice the number of females, or 718, as a more
normal population. Goddard's data give the number of houses for these villages as 92, a
figure Cook takes as representing the situation in 1850. This combination yields an
average of 7.8 persons per house. Since there had certainly been a decline in population
between 1850 and 1870, Cook proposes that the figure for the density of population be
raised to 10 persons per house.
But Goddard does not say what period his figures represent, so I propose to follow a line
of reasoning similar to that of Cook but to use different figures. The number of houses
for 6 villages in 1851 is reported by Gibbs (see map, pl. 9). We may compare these to the
1870 population estimates as given by Kroeber (1925a, p. 131). If we adjust for male
attrition by calculating population as twice the female population, or 640 (see table 1),
we get a density per house of 7.8, exactly the same figure that Cook gets.
TABLE 1
Hupa Population, 1870[1]
Village Males Females Houses
Honsading 25 30 9
Miskut 32 49 6
Takimitlding 51 74 20
Tsewenalding 14 31 10
Medilding 75 100 28
Djishtangading 14 36 9
Total 211 320 82
[1] Kroeber, 1925a, p. 131.
That there was a decline in population between 1850 and 1870 is agreed by all
authorities. This fact makes it very attractive to accept Cook's proposed density of 10
persons per house for the Hupa in aboriginal times. But there are two objections to this
procedure. For one thing, the population figures for 1870 may be inaccurate. In the
census of that year, there were reported 874 Indians of all tribes on the Hoopa
Reservation (Kroeber, 1925a, p. 131). But in the same year another agent reported only
649 Indians on the reservation. This is a 25 per cent reduction, and if we reduce the
population estimate of 640 by 25 per cent, we get 480 as the estimate for 1870 and a
density per house of 5.9. If we raise the population of 480 to account for the 1850-1870
reduction, we are again close to the figure 7.5 persons per house. This calculation is
presented merely to indicate that the figures are not reliable.
The other objection to accepting Cook's proposed figure for density is that the
established figure for the Yurok is 7.5 persons per house. According to Cook, this figure
was based on an underlying assumption that "the social family in the usual monogamous
tribe included the father, mother, children, and occasional close relatives" (Cook, 1956, p.
99). As a matter of fact, Kroeber's estimate is not based on this assumption but is an
empirical estimate based on population counts and house counts (Kroeber, 1925a, pp.
16-19), and the figure is accepted wholeheartedly by Cook for the Yurok (1956, p. 83).
But what is certainly clear is that the social organization, house type, and environment of
the Hupa was virtually the same as that of the Yurok and therefore the population density
per house must have been the same. It is therefore clear that we must accept either 7.5
persons per house or 10 persons per house as the population density for both the Hupa
and the Yurok, and the question becomes one of comparing the reliability of the figures
given for the Yurok with those given for the Hupa. Yurok figures appear to be intrinsically
more reliable and are also earlier and I have therefore taken 7.5 persons per house as
the density.
The population for the Hupa then comes to 1,475 as compared to 2,000 estimated by
Cook and to less than 1,000 estimated by Kroeber.
Whilkut.—The number of permanent villages among the Whilkut has been estimated here
at 69. This estimate excludes known summer camps and other villages away from the
main salmon streams. For the Chilula Whilkut there are 23 villages. For the Kloki Whilkut
there are 16 villages, including several which are not shown on the map but which are
listed by Merriam as being on upper Redwood Creek. Ten villages have been taken from
the North Fork Whilkut. Twenty villages are taken from the Mad River Whilkut even
though only 16 are given in the village lists. Wherever both Merriam and Goddard worked
the same area the latter has recorded substantially more villages than the former. I have
therefore added 4 to the village count to make up for the presumptive lack, thus bringing
the total up to 69.
House-pit counts from the Chilula Whilkut are listed for six villages by Kroeber (1925a, p.
138) as 17, 7, 4, 2, 4, 8, or an average of 7 per village. Kroeber reduces this average by a
third, on the basis of his estimates for the Yurok and Hupa, to arrive at a figure of 5
houses per village. Cook (1956, p. 84) says the reduction should be only about 10 per
cent, calculated on the basis of Waterman's study of the Yurok (Waterman, 1920), and he
compromises, making a reduction of a seventh to use 6 as an average number of houses
per village.
The sample used by Kroeber and Cook is so small that an estimate based on it of the
average number of house pits per village is liable to considerable error. If we look at the
figures for some of the surrounding groups, we find an estimate of 11 houses per village
for the Hupa in Hoopa Valley, 4.5 for the Hupa outside the valley, 4 for the Wailaki, 4.5
for the Wiyot (Cook, 1956, p. 102), and 5.4 for the Lolangkok Sinkyone. The Whilkut
terrain and culture is certainly more nearly like the region outside Hoopa Valley than
inside it, so we are scarcely justified in estimating more than 5 houses per village.
On this basis we get a total of 345 houses for the Whilkut. Both Kroeber and Cook use
the Yurok figure of 7.5 persons per house in calculating the population of this group. This
figure may well be too high, and perhaps it should be more nearly the same as the
estimate for the southern groups, but since I have no concrete evidence to support such
a contention, I have also used the Kroeber and Cook figure. This gives a total population
of 2,588 for the Whilkut.
Cook's figures for the groups which were formerly listed under the Chilula and Whilkut
were 800 and 1,300 making a total of 2,100. Kroeber's figures were 600 and 400 for a
total of 1,000. The difference between Cook's figures and those given here is partly due
to the fact that Cook took the group on the North Fork of the Mad to be Wiyot, whereas I
have them as Whilkut. Also Cook made a reduction of a ninth in his Mad River estimates
because of the poor environment there. I have not done this because the Mad River
region does not seem to me noticeably poorer than that along Redwood Creek.
ESTIMATES BASED ON FISH RESOURCES
For the six tribes just discussed, the ethnographic notes at our disposal offer a means of
estimating the population, but we have also another basis for our calculations. Fishery
was the most important single factor in the California Athabascan economy, hence the
fish resources of the region undoubtedly exerted a marked influence on population size.
Therefore, before attempting to estimate the population of the remaining groups, for
which we have scanty ethnographic information, I would like to present some data on the
fish resources of the region.
I have attempted to calculate the number of stream miles of fishing available and thereby
to form some estimate of the economic basis of each of the groups. Most of my
information comes from Mr. Almo J. Cordone, Junior Aquatic Biologist of the California
Department of Fish and Game, who was kind enough to gather the relevant data from
the records of that organization. I have not included material on the freshwater trout,
which was apparently too scarce to be important, or on the lamprey eel, on which we do
not have sufficient information, although it was of some importance, especially in the Eel
River and its tributaries.
The available stream miles of fishing may seem insufficient material on which to base
estimates of fish resources and unquestionably it would be desirable to have some idea
of the fish population per mile of stream in order to estimate the food value of the
resources available to the people. On the other hand, this point may not be as crucial as
it seems, for apparently the fish population was not a governing factor in the number of
fish taken by the Indians. According to Rostlund (1952, p. 17), the aboriginal fishermen
of California did not even approach overfishing. If this is so, then there must have been
fish left uncaught even in the smaller salmon streams and it would therefore seem that
one stream was nearly as good as another, if it carried salmon at all. An exception would
be the Trinity River and its tributaries, the only streams in the Athabascan area with both
spring and fall runs of salmon. In other streams there is only a fall run.
The lists that follow include data, not only for the six tribes previously discussed (Wailaki,
Pitch Wailaki, Mattole, Lolangkok Sinkyone, Hupa, and Whilkut), but also for the Nongatl,
Kato, Shelter Cove Sinkyone, Lassik, and Bear River groups. The fish species is recorded,
when it is known; when our source gives no identification of species, however, the
generic term is used.
Available Stream Miles for Fishing in Tribal Territory
KATO 29 mi.
South Fork Eel R.—19 mi. Quantities of steelhead and silver salmon go up at least to
Branscomb and King salmon go at least to Ten Mile Cr. (Dept. of Fish and Game).
Hollow Tree Cr.—5 mi. There was fishing on this stream (Gifford, 1939, p. 304). Fish
not specified, probably steelhead and salmon.
Ten Mile Cr.—5 mi. This stream appears to be large enough for salmon and there
were villages on it. Also the Fish and Game information for South Fork implies fish in
the stream.
WAILAKI (Eel R. and North Fork Wailaki) 23 mi.
Eel R.—16 mi. There are good runs of salmon as far up as Lake Pillsbury (Dept. of
Fish and Game).
North Fork Eel—7 mi. Salmon go up North Fork farther than 7 mi. (see Pitch Wailaki).
PITCH WAILAKI 15 mi.
North Fork Eel—12 mi. See below.
Casoose and Hulls creeks—3 mi. The Dept of Fish and Game states that salmon do
not ascend North Fork above Asbill Cr. but Goddard's informant (see Pitch Wailaki
Village no. 21) said that fish got up into Hulls and Casoose creeks, the mouths of
which are above Asbill Cr. The Dept. of Fish and Game information may refer to a
more recent situation.
LASSIK 25 mi.
Eel R.—17 mi. (See Wailaki.)
Dobbyn Cr.—8 mi. There would seem to have been fish in Dobbyn Cr., since it is a
fair-sized stream and there were many villages on it.
SHELTER COVE SINKYONE 67 mi.
South Fork Eel—39 mi. There were a good many fish in South Fork as far up as
Branscomb (Dept. of Fish and Game).
Redwood Cr.—5 mi. According to Merriam the region around Redwood Cr. was a
center for the Shelter Cove Sinkyone; therefore there must have been fish in the
creek.
Mattole R.—11 mi. There is a partial barrier to salmon at the community of Thorn but
some fish get up even beyond this (Dept. of Fish and Game).
East Branch, South Fork Eel—4 mi. King salmon and silver salmon go up at least to
Squaw Cr. (3 mi.) and steelhead go up at least to Rancheria Cr. (4.5 mi., according to
the Dept. of Fish and Game).
Sea Coast—8 mi. The Shelter Cove Sinkyone have 16 mi. of sea coast. The only
reliable data on the density of sea coast population in relation to the riverine
population are given by Kroeber (1925a, p. 116). According to his figures, the
seashore is about half as productive as the rivers and I have therefore halved the
sea coast mileage in the calculation of available fishing miles.
LOLANGKOK SINKYONE 63 mi.
Eel R.—27 mi. (See Wailaki.)
South Fork Eel R.—16 mi. (See Kato.)
Bull Cr.—6 mi. According to Merriam, there was a large settlement on Bull Cr. It could
not have been supported without fish.
Salmon Cr.—5 mi. Goddard mentions fishing on at least part of this stream.
Mattole R.—10 mi. The fish go beyond this stretch at least as far as Thorn (Dept. of
Fish and Game).
MATTOLE 38.5 mi.
Mattole R.—25 mi. The fish go considerably beyond here in the Mattole.
North Fork Mattole—5 mi. North Fork is a sizable stream and there were several
villages along it, so it probably had fish in it.
Sea Coast—8.5 mi. The Mattole have 17 mi. of sea coast. This has been halved in
accordance with the principle stated above.
BEAR RIVER 21 mi.
Bear R.—18 mi. This figure is rather arbitrary since the information is poor for this
stream. It is known that silver salmon and steelhead are caught there and that there
is a fall run of King salmon (Dept. of Fish and Game).
Sea Coast—3 mi. The Bear River group has 6 mi. of sea coast, halved for present
purposes.
NONGATL 85 mi.
Van Duzen R.—40 mi. Steelhead go up as far as Eaton Roughs (40 mi.). Silver
salmon go up as far as Grizzly Cr. (21 mi.) and probably as far as Eaton Roughs.
There are no data on King salmon but it is known that there is a fall run of them
here. Information from Dept. of Fish and Game.
Eel R.—5 mi. All 5 mi. of the Eel in Nongatl territory should provide excellent fishing.
Larabee Cr.—20 mi. There is no direct information on this stream, but it is of
considerable size and there were many villages at least 20 mi. up.
Yager Cr.—20 mi. Again we have no direct information but there are many villages
far up on this stream. Twenty miles of available fishing is probably a conservative
estimate.
Mad R.—0 mi. There is a long stretch of Mad R. in Nongatl territory but, according to
the Dept. of Fish and Game, no fish go up so far.
WHILKUT 70 mi.
Mad R.—27 mi. There is a 12-ft. falls at Bug Cr. which represents a nearly complete
barrier to salmon. This means that there are salmon in nearly all the territory of the
Mad R. Whilkut.
North Fork Mad R.—8 mi. According to Merriam, there were fishing camps nearly this
far up on North Fork.
Redwood Cr.—35 mi. There is no direct information on this stream. I have attributed
salmon to nearly its whole length because of the size of the stream and the large
number of villages along its upper course.
HUPA 39 mi.
Trinity R.—27 mi. There are fish in this whole stretch (Dept. of Fish and Game).
South Fork Trinity—12 mi. There are known to be salmon in South Fork, and
presumably they go up as far as the border of Hupa territory.
TABLE 2
Area, Fishing Miles, and Population Estimates
Tribe[2] Pop. Estimate Area Ln Area Fishing Miles Ln Fishing Miles
Wailaki 1,656 296 5.69 23 3.14
Pitch Wailaki 1,104 182 5.20 15 2.71
Mattole 1,200 170 5.14 38.5 3.65
Lolangkok Sinkyone 2,076 294 5.68 63 4.14
Hupa 1,475 424 6.05 39 3.66
Whilkut 2,588 461 6.13 70 4.25
Average 1,683 5.65 3.59
[2] Relatively complete village counts.
TABLE 3
Area and Fishing Miles
Tribe[3] Area Ln Area Fishing Miles Ln Fishing Miles
Kato 225 5.42 29 3.37
Bear River 121 4.80 21 3.04
Lassik 389 5.96 25 3.22
Nongatl 855 6.75 85 4.44
Shelter Cove Sinkyone 350 5.86 67 4.20
[3] Incomplete village counts.
GROSS ESTIMATE
From the preceding data we have obtained population estimates for certain of the
California Athabascan groups. If these estimates are judged reliable, it would be desirable
to use them as a basis for estimating the population of the remaining groups. When a
detailed analysis of the ecological or demographical factors involved is lacking, it is
sometimes necessary to fall back on rather simplistic assumptions to attain the desired
end. Cook goes rather far in this direction, using simply the average population density
per square mile of the known groups to estimate the population of the unknown groups.
It appears to this writer that a somewhat more satisfactory method of estimation would
be based on simple linear regression theory. It is a fact that pertinent relationships in
population studies can often be expressed in terms of simple exponential functions or in
linear combinations of logarithms. Thus we might propose a relationship such as the
following:
population = a + b (ln area)
or
population = a + b (ln fishing miles)
where a and b are constants to be determined and ln is the logarithm to the base e.
Of course we would not expect these relationships to be precise. The lack of exactness
might be due to the crudeness of the various measurements involved or perhaps to the
fact that population depends on more than one such factor. To account in some way for
the uncertainty, we might make a further assumption and propose the following
relationships:
population = a + b (ln area) + X
population = a + b (ln fishing miles) + X
where X has a normal probability distribution with mean = 0 and some unknown variance
= σ2
. X is then, roughly speaking, the error involved in each observation. That the error
would be distributed normally is quite reasonable under the circumstances. In situations
where the uncertainty of the observation is due to measurement error or to a multiplicity
of factors, the distribution obtained often assumes a normal form or a form sufficiently
normal so that the normal distribution can be used as an approximation.
One additional assumption is necessary. We must assume that the sample used is taken
in a random fashion from the population to be studied. In the present investigation, the
sample is definitely not taken at random, since we are using all groups for which we have
population estimates based on ethnographic information. The question is, then, whether
this selection of groups would result in some bias. For instance, the groups for which we
have ethnographic data might be the most numerous in the first place and might thus
cause us overestimate the population of the remaining groups. On the whole, it would
seem to me that there is no such bias and that the assumption of a random sample is
therefore not misleading, at least in the direction of overestimation. If we now consider
each group for which we have no ethnographic data, we can see whether the lack of
such data is due to an initially small population or to mere luck.
Kato: The reason Kato population is being estimated in gross rather than from
ethnographic data is that Goddard (1909, p. 67) obtained a list of more than 50
villages which are not available for calculation.
Bear River: Here the lack of information is due simply to the fact that it was not
collected. There have been several informants living until recently (see Nomland,
1938).
Lassik: There was at least one good informant living until recently (Essene, 1942),
but Merriam worked with her only briefly. Goddard evidently recorded a number of
villages from this group, but his notes are lost.
Nongatl: Goddard seems to have worked with at least two informants from this
group, but he spent a very brief time in the area and some of his notes may have
been lost.
Shelter Cove Sinkyone: Several informants from this group have been alive until
recently (see Nomland, 1935). No one saw fit to collect the appropriate data.
It is obvious from this summary that the main reason for our lack of information on these
groups is the loss of Goddard's notes. If those were at hand, we would probably have
complete information on the Kato, the Lassik, and probably the Nongatl. The absence of
data on the Bear River and Shelter Cove Sinkyone is due to the ethnographers' oversight.
None of these groups, therefore, seem to have been selected because of their small
aboriginal population. If the following estimates are in error because the sample is not a
random one, then the error is probably one of underestimate rather than overestimate.
Given the foregoing assumptions, the least squares estimate of the normal regression line
may be obtained with the following formula.
P: population. A: area. F: fishing miles.
The equations of the lines are:
P = a + b (ln A)
P = a' + b' (ln F)
the estimate of b is (Bennett and Franklin, 1954, p. 224)
Σ(Xi − X̅)(Yi − Y̅)
b̂ = ------------------------------------
Σ(Xi − X)2
and of a is
â = Y̅ − b̂ X̅
where Xi = ln A for each group with known population and Yi = P for each known group.
Similarly the estimate of b' is
Σ(Xi − X̅)(Yi − Y̅)
b̂' = ----------------------------------
Σ(Xi − X̅)2
and of a' is
â' = Y̅ − b̂ 'X̅
where Xi = ln F for each known group and Yi = P for each known group. These
calculations are shown in table 4.
TABLE 4
Calculation of Regression Lines Shown in Figure 2
Fishing Miles
(Xi − X̅ ) (Yi − Y̅ ) (Xi − X̅ )·(Yi − Y̅ ) (Xi − X̅ )2
-.452 -.027 .012 .204
-.882 -.579 .511 .778
.058 -.483 -.028 .003
.548 .393 .215 .300
.068 -.208 -.014 .005
.658 .905 .595 .433
Total. ... ... 1.291 1.723
Area
(Xi − X̅ ) (Yi − Y̅ ) (Xi − X̅ )·(Yi − Y̅ ) (Xi − X̅ )2
.041 -.027 -.001 .002
-.445 .579 .258 .198
-.514 -.483 .248 .264
.034 .393 .013 .001
.400 -.208 -.083 .160
.484 .905 .438 .234
Total. ... ... .873 .859
The results are the following equations, which are shown, together with the points from
which they were calculated, on figure 2.
P = 1.02 (ln A) − 4.06
P = .75 (ln F) − 1.00
Thus, given either the area of a group or the fishing miles of a group habitat, we may
estimate its population. From the diagram in figure 2 it appears that the estimates based
on area have greater dispersion than those based on fishing miles and are therefore less
reliable. This fact can best be made precise by using the above assumptions to obtain the
confidence intervals for each of the estimates. The confidence intervals for the area
estimates are given by the following formula (Bennett and Franklin, 1954, p. 229).
{1 (Xo − X̅)2
}
1.02 Xo − 4.06 ± t∝Sa × √{- + -----------}
{6 Σ(Xi − X̅)2
}
where the symbols have the following values and meanings:
[10.6] Xo: the log of the area of the group for which the population is being
estimated.
Xi: the log of the area of each of the groups for which the population is already
known.
X̅ : the average of the Xi.
t∝: the upper ∝-point of the t-distribution (Bennett and Franklin, 1954, p. 696)
where 1-∝ is the confidence coefficient.
{1 }
Sa = √{- × Σ(Yi + 4.06 − 1.02Xi)2
}
{4 }
where Yi is the population of each of the groups for which population is known. This
is the estimated standard deviation of population where the estimate is made from
area.
Fig. 2. Simple linear regression of population. a. Regression of population on ln
area. b. Regression of population on ln fishing miles.
The confidence intervals for the fishing-mile estimates may be obtained in similar fashion
—simply substituting the words fishing mile for area and Sf for Sa.
For calculating the confidence intervals for area we have the following quantities:
X̅ = 5.56
t.2 = 1.533
Σ(Xi − X̅ )2
= .859
Sa = .3594
The calculations are shown in table 5.
The comparable quantities in calculating the confidence intervals for fishing-mile
estimates are:
X̅ = 3.70
t.2 = 1.533
Σ(Xi − X̅ )2
= .932
Sf = .394
The calculations are shown in table 6.
TABLE 5
Calculation of Confidence Intervals for Area
Tribe Xo
(Xo −
X̅ )
(Xo − X̅ )2
-------------
--
Σ((Xi −
X̅ )2
)
{ (Xo −
X̅ )2
}
√{1/6 + ------------
----}
{ Σ((Xi −
X̅ )2
)}
{ (Xo − X̅ )2
}
t.2Sa × √{1/6 + ----------
------}
{ Σ((Xi − X̅ )2
)}
Kato 5.42 -.23 .0616 .4778 .263
Bear River 4.80 -.83 .8510 1.0088 .556
Lassik 5.96 .31 .1119 .5278 .291
Nongatl 6.75 1.10 1.4086 1.2551 .692
Shelter Cove
Sinkyone
5.86 .21 .0513 .4669 .257
TABLE 6
Calculation of Fishing-Mile Estimates
Tribe Xo
(Xo −
X̅ )
(Xo − X̅ )2
-------------
--
Σ((Xi −
X̅ )2
)
{ (Xo −
X̅ )2
}
√{1/6 + ------------
----}
{ Σ((Xi −
X̅ )2
)}
{ (Xo − X̅ )2
}
t.2Sf × √{1/6 + ----------
------}
{ Σ((Xi − X̅ )2
)}
Kato 3.37 -.22 .0281 .4414 .267
Bear River 3.04 -.55 .1756 .5851 .353
Lassik 3.22 -.37 .0795 .4962 .300
Nongatl 4.44 .85 .4193 .7655 .462
Shelter Cove
Sinkyone
4.20 .67 .2160 .6186 .374
The results of the calculations are given in table 7. The figures are point estimates with
80 per cent confidence intervals. This means that under the assumptions given earlier we
expect that the tabled intervals will contain the true population 8 times out of 10. I have
accepted the estimates derived from fishing miles because their confidence intervals are
a bit shorter on the average.
TABLE 7
Population Estimates and Confidence Intervals
Tribe Fishing-mile Estimate Area Estimate
Kato 1,523 ± 267 1,470 ± 263
Bear River 1,276 ± 353 840 ± 556
Lassik 1,411 ± 300 2,020 ± 291
Nongatl 2,325 ± 462 2,830 ± 692
Shelter Cove Sinkyone 2,145 ± 374 1,920 ± 257
The question of whether the fishing-mile estimates yield shorter confidence intervals than
the area estimates brings up an entire range of problems pertaining to economy,
settlement pattern, and the like. The obvious interpretation of the shorter confidence
intervals would be that the economy of the people in question depended more on fish
and fishing than on the general produce over the whole range of their territory. The
question then becomes one of quantitative expression—we would like to have some index
of the extent of dependence on various factors in the economy. This might best be
approached from the standpoint of analysis of covariance, where we would obtain the
"components of variance." This technique is a combination of the methods of regression
used in this paper and those of the analysis of variance. It would evidently yield sound
indices of economic components, but it involves, for myself at least, certain problems of
calculation and interpretation which will have to be resolved in the future.
Another problem of this kind turns on the question of which factors are important in
which area. Considering the State of California, for instance, we might want to know
about such factors as deer population, water supply, the quantity of oak trees, etc. Any
one of these factors or any combination of them might be important in a particular area;
the problem of gathering the pertinent information then becomes crucial. Moreover,
because the situation has changed since aboriginal times, we must combine modern
information with available historic sources. S. F. Cook has shown that energetic and
imaginative use of these sources yields very good results (e.g., Cook, 1955).
Finally, there is the problem of the assumptions we were required to make in order to
obtain our population estimates. Although many of the assumptions in the present paper
are difficult to assess, the two which I would like to discuss here were particularly
unyielding—the assumptions of the number of persons per house and the assumptions of
the number of houses per village.
The question of how many persons there were per house has been dealt with extensively
by both Kroeber and Cook. There is also a great deal of random information in the
ethnographic and historical literature. I believe there are enough data now at hand to
provide realistic limits within which we could work, at least for the State of California.
This information should be assembled and put into concise and systematic form so that it
would be available for use in each area. It would also be of interest in itself from the
standpoint of social anthropology.
For the number of houses per village we have also a considerable body of information,
but here we are faced with a slightly different problem. It often happens that we know,
from ethnographic information or from archaeological reconnaissance, how many house
pits there are in a village site but do not know how many of the houses which these pits
represent were occupied simultaneously. In the present paper it has been assumed that
four-fifths of the house pits represents the number of houses in the village occupied at
any one time. This, however, is simply a guess, and one has no way of knowing how
accurate a guess. The solution to this problem is simple but laborious. From each area of
the State a random sample of villages with recorded house counts should be taken. Each
of these village sites should then be visited and the house pits counted. A comparison of
the two sets of figures would give us a perfectly adequate estimate, which could then be
used subsequently over the entire area.
TABLE 8
Population Estimates
Tribe
Area
(sq.
mi.)
Fishing
Miles
Pop.
Estimate
Area
Density
Fishing-
mile
Density
Kroeber[5]
Estimate
Cook[6]
Estimate
Kato[4] 225 29 1,523 6.77 52.5 500 1,100
Wailaki 296 23 1,656 5.59 72.0 600 2,315
Pitch Wailaki 182 15 1,104 6.07 73.6 400 1,032
Lassik[4] 389 25 1,411 3.63 56.4 500 1,500
Shelter Cove
Sinkyone[4] 350 67 2,145 6.13 32.0 375 1,450
Lolangkok 294 63 2,076 7.06 33.0 375 1,450
Sinkyone
Mattole
170 38.5 1,200 7.06 31.2 350 840
Bear River[4] 121 21 1,276 10.55 60.8 150 360
Nongatl[4] 855 85 2,325 2.72 27.4 750 3,300
Whilkut 461 70 2,588 5.61 37.0 1,000 2,100
Hupa 424 39 1,475 3.48 37.8 1,000 2,000
Total 3,767 475.5 18,779 4.99 39.5 6,000 17,447
[4] The population figures for these groups are estimated in the gross by the method
indicated in the text.
[5] Kroeber, 1925a, p. 883. The breakdown has been changed somewhat to
accommodate boundary changes; the total remains the same. The population density,
according to Kroeber's figures, is 1.6 persons per sq. mi.
[6] Cook, 1956. The breakdown has been changed somewhat to accommodate
boundary changes; the total remains the same. The population density, according to
Cook's figures, is 4.6 persons per sq. mi.
The corpus of information provided by the methods outlined above would be useful in
two ways. First, it would clarify our definitions of the economic factors in the lives of
hunter-gatherers. Functional hypotheses which postulate dependence of social factors on
economy would be subject to objective, quantitative tests of their validity.
Second, the corpus of information would afford a suitable basis for inference from
archaeological data. If we can determine what were the major economic factors in the
lives of a prehistoric people, then we can make assertions about population, settlement
pattern, and the like. Conversely, information about population and settlement pattern
would imply certain facts about the economy. This technique has already been developed
to some extent. For instance, Cook and Heizer, depending on assumptions derived from
ethnographic data (Cook and Treganza, 1950; Heizer, 1953; Heizer and Baumhoff, 1956),
have made inferences concerning village populations. These methods have such great
possibilities for the conjunctive approach in archaeology that their use should be
extended as much as possible.
APPENDIXES
APPENDIX I: THE TOLOWA
The Tolowa are an Athabascan group living on the coast from a short distance north of
the mouth of the Klamath River to the Oregon-California boundary. Information on this
group has not been included in the main body of the paper because the Tolowa are
separated from the other California Athabascan groups and belong more properly with
the Oregon Athabascans; It was thought, however, that Merriam's data on the Tolowa
should be recorded and they have therefore been appended in this form. The following
passages are taken verbatim from Merriam's notes.
HAH-WUN-KWUT NOTES
The following notes are from information given me by Sam Lopez and wife and Lopez'
father at the Mouth of Smith River, Del Norte County, Sept. 16-17, 1923.
Name.—The tribe as a whole had no distinctive name for themselves except Huss, the
word for people. But they had definite names for village areas. Those living at the mouth
of Smith River call themselves Hah´-wun-kwut; those at Burnt Ranch, about three miles
south of the mouth of Smith River, Yahnk´-tah-kut; those at Crescent City Tah-ah´-ten—
and so on.
Location, boundaries, and neighbors.—The territory of the tribe as a whole extends from
Winchuk River (Um-sahng´-ten) on the California-Oregon boundary south to Wilson
Creek (Tah-geshl
-ten) about eight miles north of the mouth of Klamath River.
The coast tribe immediately north (on the Oregon side of the line) is called Cheet or Che
´-te. Their language differs materially from that of the Hah´-wun-kwut, though most of
the words could be understood. Only a single woman survives.
The tribe on the south, from Wilson Creek to Klamath River, is called Tah-che-ten-ne and
Tet-le-mus (Polikla).
The tribe immediately east of the Cheet on the Oregon side of the California-Oregon
boundary is called Ka-Ka-sha. Another name, Choo-ne, also was given but I am in doubt
as to whether or not the same tribe was meant. The Ka-ka-sha live near Waldo on the
north side of the Siskiyou Mountains and speak a language widely different from that of
the Hah´-wun-kwut. They are said to be lighter in color than the coast Indians.
Dress and ornament.—The people used deer skin blankets called Nah-hi-ne tanned with
the hair on, and also blankets of rabbit skin, called Wa-gah hahs-nis-te. Deer skins
tanned with the hair on are called Nah-ki-le. The breech cloth formerly worn by the men
was called Rut-soo and tat-es-tat. Moccasins, Kus-ki-a, of elk hide were worn by rich
men.
The women wore a front apron called Sahng; and on dress occasions an ornamented
cloak-like skirt (Chah) that extended all the way around and lapped over in front. They
also wore basket hats, called Ki´-e-traht´ and necklaces, the general term for which is
Ni-ta-kle-ah. On occasions they wore ear pendants, Bus-shra-mes-lah, of elk or deer
bone. Nose bones or shells, Mish-mes-lah, were sometimes worn; those of rich persons
consisted of one of the long Dentalium shells. The chin is tattooed with three narrow
vertical lines called Tah-ah ruthl
-tes.
Houses.—The houses (Munt) were square and were built of planks or slabs hewn from
redwood trees and stood up vertically, as in the case of those of the Klamath River
Indians. The ceremonial houses are called Nā´-stahs-mā´-ne. They are square and have
a ridge roof. During important dances the front side is removed. The sweat house is
called Shes´-klĕ and is large enough to hold twenty people. It is square or rectangular,
and the ground floor is excavated to a depth of about four feet. The roof is of hewn
planks covered with earth.
Money.—The ordinary medium of exchange or "money" (Trut) consisted of shells of
Dentalium, of which the valuable long ones are called Tā´-tos, the commoner short ones
Kle´-ah. Clam shell disks or buttons are called Nah´-set.
Treatment of dead.—The dead are buried in a grave (Chĕ´-slo). The people assert that
they never burned their dead. They say that a spirit or ghost, called Nah-who´-tlan, goes
out of the body after death and becomes a ghost.
Ceremonial dances.—Dances are called Nā´-stahs or Nesh-stahsh. A puberty dance,
Chahs´-stah wā´-nish tahs, was held for the girls. Other important dances are held.
Some last 5 days; others last 10 days.
The ceremonial drums Hah´-et-sah differ radically from those of any other California
Indians known to me. They are large cooking baskets about two feet in diameter. Only
new baskets are used in order that they may stand the drumming.
Rattles called Chah-pāt´-chah are made of the small hoofs of deer. Cocoon rattles were
not used.
Whistles, called Tut´-tle-nik are made of large quill feathers of birds, not of bone.
The stick game.—The stick game is a feature of the people, as in most California tribes. It
consists of a number of slender sticks called Not-trā´-le, of which one, called Chah-when
´, is marked. The counters are called Chun´; the man who keeps count, Chun-ting. A
dressed buckskin is stretched tightly on the ground between the players, and when the
game is called, the sticks are thrown down upon it.
Baskets.—The basketry is of twined weave called Chet-too. The big storehouse baskets,
called Hawsh-tan, are closely woven and have a shallow saucer-shape lid. The large open
work burden basket is called Tus, the large cooking basket, Met-too´-silch
, the small
mush bowl Hah´-tsah, the large shallow meal tray Mes-chet´-te-gah´, the large open
work shallow bowl Tre-kwahs´-tuk, the small open work plate or platter Kah´-se, the
subglobular choke-mouth trinket basket Net´-tah, the milling basket Ki´-e-sut, the baby
basket Kah´-yu, its shade Ne´-whats-tah, the women's basket hat Ki´-e-traht´. There is
also a subglobular openwork basket called I´-ă-loo´ with an arched handle for carrying
on the arm.
The cooking bowls, mush baskets, and other small baskets are made of spruce roots,
'Hre´, more or less covered with an overlay of bear grass (Xerophyllum, called Too-tĕchl
)
and maiden hair fern (Adiantum) called Ke´-tsi-shah´-te, meaning Blue-jay knees,
because of the slender form and black color. The roots used in the carrying baskets, baby
baskets, and other coarse baskets are of hazel, called 'Kun. The common black design in
ordinary baskets consists of Spruce roots that have been buried in dark mud and are
called Tah´-che-gut-kle-ah. They are ordinarily used in connection with the bear grass
(Xerophyllum).
Fragments of Hahwunkwut myths.—Skum, Coyote man, made the world.
When the sun dropped down the Coon caught it up and it was hot, and blackened the
insides of his hands.
When the world first floated there was just one big white Redwood tree called Kus-choo
´-ke. A big Eagle was sitting on the tree and was king of the world.
The Falcon (Tah´-tes) won the battle for the people.
Hahwunkwut foods.—A large variety of foods are eaten: meat (Chā´-sun) of elk and deer,
both fresh and dried, salmon and other fish, fresh and dried, marrow, tallow, salmon
eggs (usually smoke-dried), clams of several kinds, mussels, fish milt both dried and
fresh, acorn mush and bread, and a number of roots, berries, and other parts of plants.
Among the food berries are strawberries, blackberries, salmon-berries, huckleberries,
salal berries, elder berries and manzanita berries.
Elder berries are mixed with blackberries and steamed in the ground oven; manzanita
berries are mashed and mixed with smoke-dried salmon eggs.
Two kinds of kelp are eaten.
Root masses of the brake fern (Pteris aquilina, called Tah´-sohn-ki) are cooked in the
ground oven. They are said to be like milk and have a fine flavor.
Salt is not used.
Wild tobacco is called Yahn-sĕch
yah-we and Sĕch
-yu. The pipe is straight and is called A-
chah.
Hahwunkwut plant notes.—The Tree Maple (Acer macrophyllum) is called Chā´-she. Its
inner bark is used for the ordinary everyday dress for women.
The Tanbark Oak is the dominant species in the northwest coast region and its acorns
(Sohng´-cheng) are largely eaten by the people. Acorn meal before leaching is called
Rut-ta-gaht. If it is allowed to become mouldy, the bitter taste disappears so that it does
not have to be leached. Acorn bread cooked on hot ashes is called Seshl
-te. The ordinary
mush is called Ma-guts-kush.
Hahwunkwut animal notes.—The Bobcat (Lynx rufus) is called Ne´-ti-us ah´-nā. Its name
is never mentioned in the presence of a baby. If the mother sees one before the baby is
born, the baby will have fits and die.
The falcon or Duck Hawk (Tah´-tes) was a high personage among the First People. He
won the first battle for the Indians, standing on the first Redwood Tree.
The California Condor (Tā-long-yi´-chah) is so big and powerful that he can lift a whale.
His name shows this as it is from the name of the whale (Tā´-lah) and means "whale
lifter."
The Dove (Sroo´-e-gun´-sah) cries for his grandmother, especially in the spring of the
year.
The Purple Finch is called Klah´-nis-me´-tit-le, meaning "many brothers," because the
birds go together in small flocks.
The Night Heron (Nah-gah´ che yahs´-se) is known as the "sickness bird."
Hahwunkwut pits for catching elk and deer.—The Smith River Hah-wun-kwut used to
catch elk and deer in pits, called Song´-kit, dug in the ground along the runways. These
pits differ materially from those of the Pit River Indians, being much shallower. No effort
was made to make them deep enough to prevent the captured animals from jumping
out, but an ingenious device was used to prevent them from jumping. The pits were only
a little deeper than the length of the legs of the elk, but poles were placed across the top
so that when the animal fell through, the body would rest on the poles so his feet could
not touch the ground. This of course prevented him from jumping out.
When "set," the pits were lightly covered with slender sticks and branches and leaves, to
resemble the surrounding ground, but the cover was so frail that an animal the size of a
deer would at once break through.
Smelt fishery.—At Ocean Shore, Smith River, Calif., July 21, 1934. Vast numbers of smelt,
a small surf fish, are caught in nets by the Hawungkwut Indians. During a "run" at high
tide flocks of sea gulls hover over the incoming fish, thus making their approach known.
The Indians catch them with nets. After a preliminary drying on a circular mat of brush
called the nest, the smelt are transferred to the fish bed, a long flat rectangular and
slightly elevated area built up of sand and capped with a layer of small smooth stones.
On this they are left till thoroughly dry.
Massacres of Huss Indians by the whites.—There were three notable killings by the
whites.
The first killing took place at Burnt Ranch, three miles south of the mouth of Smith River,
at the rancheria called Yahnk-tah´-kut, a name perpetuated by the district school house
name. Here a large number of Indians were caught during a ceremonial dance and
ruthlessly slaughtered. The Indians say this was the first killing.
The second killing was at the rancheria of Ā´-choo-lik on the big lagoon known as Lake
Earl about three miles north of Crescent City [cf. Drucker's etculet in Drucker, 1937, map
3]. The Indians were engaged in gambling at the time.
The third killing was at the large village of Hah-wun-kwut [Xawun hwut, Drucker, 1937,
map 3] at the mouth of Smith River.
At the time of the Indian troubles in northwestern California Chief Ki´-lis (named for Ki-o-
lus the Willow tree) was chief of the Hah´-wun-kwut tribe.
Three young men of the tribe were active in resenting the aggressions of the whites and
were said to have killed several of the early settlers. They were very clever and neither
the settlers nor the soldiers were able to capture them. Finally the officer in charge of the
troops at Fort Dick (a log fort on Smith River, about three miles from the present
settlement called Smith River Corners) told Chief Ki´-lis that he would be hung by the
soldiers unless he captured the three young men in question.
It happened that the chief had two wives, who were sisters of the three young men. The
chief was in great trouble and called a meeting of his head men. They said that if the
people would contribute enough blood money (which consists of the long Dentalium
shells) they could pay the two sisters the price necessary to atone for the killing in
accordance with the law of the tribe. The people agreed to this and raised the necessary
money. The nearest male relatives of the young men were chosen to do the killing, but
the young men could not be found.
One day when one of the chief's wives was getting mussels near the mouth of Smith
River one of the young men appeared and told her that he and his brothers were hungry
and wanted food. She designated a place on the point of a nearby ridge where she said
she would take food, and it was agreed that the three brothers would come to get it in
the late afternoon or early evening. She then went home and told her husband, Chief Ki-
lis, who in turn notified the nearest relatives of the young men; they went and concealed
themselves near the spot. When the young men came and were looking for the food their
relatives fell upon them and killed them. They were buried in the same place and the
graves may be seen there to this day.
The officer in charge of the troops was greatly pleased. He and his soldiers arranged "a
big time," giving the Indians plenty to eat and also some blankets. This ended the
"Indian war" in that region.
There is a small island called Stun-tahs ahn-kot (50 acres or more in extent) in the lower
part of Smith River, half or three-quarters of a mile from its mouth. On some of the early
maps it bears the name Ta´-les after the chief. This island the officer gave to the Indians
in the name of the Government, telling them it would always be theirs, and gave the
chief a paper stating that it was given in return for killing the three outlaw boys.
Sometime afterward this paper was burned.
After the Indians had been driven to the Hoopa Reservation and had come back, they
were not allowed to go to their former rancheria Hah´-wun-kwut, but were told to go to
this island. Later the whites claimed the island and did not let the Indians have it.
The present Indian settlement, a mile or two north of the mouth of Smith River, was
purchased for the Indians in or about 1908 by Agent Kelsey of San Jose, and paid for by
the Indian Office from a part of an appropriation made by Congress for homeless
California Indians. It is occupied at present (1923) by ten or a dozen families.
APPENDIX II: NOTES ON UPPER EEL RIVER INDIANS
By
A. L. Kroeber
YUKI "TRIBES"
The following data were got from Eben Tillotson at Hulls Valley, north of Round Valley, on
July 12, 1938.
A. Eben said he was a Wi·t'u·knó'm Yuki. This was a "tribe" speaking a uniform dialect,
having uniform customs, but embracing several "tribelets." Their general territory was
along main (or middle) Eel R. where this runs from E to W, on both sides of it, and S of
Round V. They also owned Oklá·c̆ and Púnki·nipi·ṭ ("wormwood hole"), Poonkiny. The
subdivisions or tribelets were:
[10.6] 1. Us̆ i·c̆ lAlhótno'm ("crayfish-creek-large-people") on Salt Cr., S of Middle Eel.
2. Olkátno'm, at Henley or Hop ranch in S part of Round V., where the road enters
the flat of the valley. They owned S to the Middle Eel and down it to Dos Rios
confluence.
3. Alniuk'í·no'm, at W edge of Round V.
4. Ontítno'm, E of Henley ranch in Round V.; also Eden V. to S.
B. The following were not grouped together by the informant, but agree in having a
southerly range:
[10.6] 5. LAlkú·tno'm, around Outlet Cr.
6. Tí·tAmno'm, eastward, across (S of Middle) Eel R., toward Sanhedrin Mt., W of the
ridge which runs W of Gravelly V. Mountain people, without villages of size. Dixie
Duncan was half of this group.
7. Ki·c̆ ilú·kam is Gravelly V. The Huchnom roamed in that.
C. East of Hull's V., extending nearly to Hammerhorn Mt., but this was Nomlaki.
[10.6] 8. ŠipimA´lno'm, on a creek running from W into (S-flowing) Eel R.
9. I·'mptí·tAmno'm, at an opening in the range—i·'mp is a gap. They were across the
Eel, on its E side.
10. Pi·lílno'm, beyond (farther E or SE?), at Kumpí·t, "salt hole," where salt was got,
also at Snow Mt. These were Yuki, but "talked something like" Nomlaki Wintun (who
adjoined them, across the main Coast Range watershed). Their language was about
as different from Yuki as was Huchnom. They were "half Stony Creek" (along which
lived Salt Pomo, then Hill Patwin, then Nomlaki).
11. U·k'í·c̆ no'm (added later by informant), in Williams V., "E" of Hull's V.
12. A Yuki group at Twin Rock Cr.—Eben had forgotten their name.
D. The real Yuki, centering in Round V., and coming N into the foothills only about as far
as Ebley's Flat. To the N were the Onainó'm, Pitch Indians, Athabascans, who owned Hull
V. ("here") and adjoined the ŠipimAlno'm (no. 8).
[10.6] 13. Hákno'm, in Round V., around Agency, in the N side of the valley.
14. Ukomnó'm, in middle of the valley. They did not own up into the mountains.
15. At TotimAl, W of Covelo, were a people whose name Eben had forgotten.
16. At NW end of Round V., another group whose name he could not recall.
It will be seen that the informant's knowledge was fullest for the part of Yuki territory S
of Round V.
He thought that all the groups mentioned made the Taikomol and Hulk'ilAl initiations and
performances.
Orthography Used
A a mid-raised a, nasalized
ṭ retroflex or palatal t
Š sh
c̆ ch
k' etc. glottalized
· long
ƚ surd l, Athabascan only
η ng Athabascan
Map 18. Yuki "Tribes" according to Eben
Tillotson.
ATHABASCAN DATA
DATA FROM EBEN TILLOTSON
Onainó'm were the Pitch Indians, a people of the rugged mountains, adjoining the ŠipimA
´lno'm Yuki, and with Hull's Valley in their range. They were "half Yuki and half Wailaki,"
and spoke both languages.
The TA´no'm were at Spy Rock on main Eel R. They were also half Yuki and half Wailaki
and bilingual. [But other Yuki cite them as Yuki who also knew Wailaki.] TAno'm were:
Nancy Dobie, Sally Duncan, and Tip.
These two groups did not make Taikomol or Hulk'ilAl rites [this agrees with Handbook]
but, probably knew about them from having seen them performed.
Between the Pitch people and the TAno'm, in the Horse Ranch country, lived the Ko'il, the
Wailaki (proper). Most of the survivors of these spoke Yuki also.
DATA FROM LUCY YOUNG
The following notes, mainly on Athabascans, were obtained at Round Valley on July 13,
1938. Lucy Young, the informant, was born on Eel River at Tseyes̆ enteƚ, opposite Alder
Point. Though listed by the Government as a Wailaki, she is actually what ethnologists
call Lassik. Her father was born 3 mi. from Alder Pt.; her mother, at Soldier Basin, 22 mi.
NE. Her mother's first cousin was T'a·su's, known to the whites as Lassik, from his
Wintun name Lasek. He was chief for Alder Pt., Soldier Basin, (upper) Mad River. Mary
Major, informant's contemporary, is from Soldier Basin and of the same tribe.
The following were obtained as names of groups of people, though some of them may be
place names.
Setelbai, "yellow rock," Alder Pt., etc.
Nals̆ a, "eat each other," downstream, around Fort Seward.
Kos̆ o-yaη, "soaproot eaters," farther downstream and on Van Duzen R.
Tenaη-keya, Mad R. Indians.
Kentetƚa(η), Kettenchow V., a flat with roots.
Sec̆ (ƚ)enden-keya, at Zenia.
Ka·snol-keya, S of Zenia, called Kikawake in Hayfork [Wintun].
Tok'(a)-keya, South Fork of Eel Indians [Sinkyone].
Sayaη, "lamprey eel eaters," the Spy Rock
Wailaki [the Ko'il of Tillotson].
Djeh-yaη, "pinenut eaters," the Pitch Wailaki, on North Fork Eel R.
[The outlook seems to have been chiefly downstream and inland.]
Non-Athabascans
C̆ iyinc̆ e, Yuki.
Baikihaη, Hayfork Wintu.
Yaη-keya, the Wintu from Weaverville to Redding; their own name was Poibos. The
same name Yaη-keya was applied also to the Cottonwood Creek Wintun, whom the
Lassik met at Yolla Bolly Mt. to trade salt. [Wintu and Wintun were treated as one
language.]
Yitá·kena, people of lowest Eel R., the Wiyot.
BIBLIOGRAPHY
Abbreviations
AA American Anthropologist
BAE-B Bureau of American Ethnology, Bulletin
SI-MC Smithsonian Institution, Miscellaneous Collections
UC University of California Publications
-AR Anthropological Records
-IA Ibero-Americana
-PAAE American Archaeology and Ethnology
American Anthropological Association
1916. Phonetic Transcription of Indian Languages, Report of Committee of American
Anthropological Association, SI-MC, Vol. 66, No. 6.
Barrett, S. A.
1908. The Ethno-Geography of the Pomo and Neighboring Indians. UC-PAAE 6:1-
332.
Bennett, C. A., and N. L. Franklin
1954. Statistical Analysis in Chemistry and the Chemical Industry. John Wiley and
Sons, New York.
Cook, S. F.
1943. The Conflict between the California Indian and White Civilization: I. UC-IA 21,
pp. 161-194.
1955. The Aboriginal Population of the San Joaquin Valley, California. UC-AR 16:31-
80.
1956. The Aboriginal Population of the North Coast of California. UC-AR 16:81-130.
Cook, S. F., and A. E. Treganza
1950. The Quantitative Investigation of Indian Mounds. UC-PAAE 40:223-262.
Curtis, E. S.
1924. The North American Indian. Vols. 13, 14.
Dixon, Roland B.
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!
ebookbell.com

More Related Content

Similar to Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel (20)

PDF
[Ebooks PDF] download C How to Program 1ST Edition Harvey M. Deitel full chap...
raaenvalko0u
 
PDF
Introduction to Programming with Java 3rd Edition John Dean
yarnoboder
 
PDF
Java Complete Reference Fifth Edition
umavanth
 
PDF
Objectoriented Programming And Java 2nd Ed Danny C C Poo Derek Beng Kee Kiong...
orianzotto3i
 
PDF
1.Java_programming2017.pdf
MohamedTarekAbdelsal
 
PDF
Java Programming.pdf
IthagoniShirisha
 
PDF
Download full ebook of Java Cookbook Ian F Darwin Darwin Ian F instant downlo...
tvuxidu670
 
PDF
Mastering Java A Beginners Guide Divya Sachdeva Natalya Ustukpayeva
aitsenerg
 
PDF
JavaScript for Programmers 1st Edition Paul J. Deitel
cisserjasri
 
PDF
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach...
chueyseipp1i
 
PPT
JavaHTP7e_0101_DDP.ppt
DrTouseefTahir
 
PDF
Javatech An Introduction To Scientific And Technical Computing With Java Clar...
papaivierkiy
 
PDF
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach...
lucotkioes
 
PPT
JAVA object oriented programming (oop).ppt
AliyaJav
 
PDF
Mastering Java: A Beginner's Guide 1st Edition Sufyan Bin Uzayr
wilkserronlc
 
PDF
Class 1 blog
Narcisa Velez
 
PDF
Starting Out with Java From control structures through Objects 7th Edition To...
sugathoosugi
 
PDF
Class 1
Dario Pilozo
 
PDF
Class 1
Dario Pilozo
 
[Ebooks PDF] download C How to Program 1ST Edition Harvey M. Deitel full chap...
raaenvalko0u
 
Introduction to Programming with Java 3rd Edition John Dean
yarnoboder
 
Java Complete Reference Fifth Edition
umavanth
 
Objectoriented Programming And Java 2nd Ed Danny C C Poo Derek Beng Kee Kiong...
orianzotto3i
 
1.Java_programming2017.pdf
MohamedTarekAbdelsal
 
Java Programming.pdf
IthagoniShirisha
 
Download full ebook of Java Cookbook Ian F Darwin Darwin Ian F instant downlo...
tvuxidu670
 
Mastering Java A Beginners Guide Divya Sachdeva Natalya Ustukpayeva
aitsenerg
 
JavaScript for Programmers 1st Edition Paul J. Deitel
cisserjasri
 
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach...
chueyseipp1i
 
JavaHTP7e_0101_DDP.ppt
DrTouseefTahir
 
Javatech An Introduction To Scientific And Technical Computing With Java Clar...
papaivierkiy
 
(eBook PDF) Introduction to Programming with Java: A Problem Solving Approach...
lucotkioes
 
JAVA object oriented programming (oop).ppt
AliyaJav
 
Mastering Java: A Beginner's Guide 1st Edition Sufyan Bin Uzayr
wilkserronlc
 
Class 1 blog
Narcisa Velez
 
Starting Out with Java From control structures through Objects 7th Edition To...
sugathoosugi
 
Class 1
Dario Pilozo
 
Class 1
Dario Pilozo
 

Recently uploaded (20)

PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
community health nursing question paper 2.pdf
Prince kumar
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Ad

Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel

  • 1. Java How To Program Early Objects Eleventh Edition Deitel Harvey M Deitel download https://ebookbell.com/product/java-how-to-program-early-objects- eleventh-edition-deitel-harvey-m-deitel-22004936 Explore and download more ebooks at ebookbell.com
  • 4. Java™ How to Program Early Objects ELEVENTH EDITION
  • 5. Deitel Series Page How To Program Series Android™ How to Program, 3/E C++ How to Program, 10/E C How to Program, 8/E Java™ How to Program, Early Objects Version, 11/E Java™ How to Program, Late Objects Version, 11/E Internet & World Wide Web How to Program, 5/E Visual Basic 2012 How to Program, 6/E Visual C# How to Program, 6/E Deitel® Developer Series Android™ 6 for Programmers: An App-Driven Approach, 3/E C for Programmers with an Introduction to C11 ® ® ®
  • 6. C++11 for Programmers C# 6 for Programmers Java™ for Programmers, 4/E JavaScript for Programmers Swift™ for Programmers Simply Series Simply Visual Basic 2010: An App-Driven Approach, 4/E Simply C++: An App-Driven Tutorial Approach VitalSource Web Books http://bit.ly/DeitelOnVitalSource Android™ How to Program, 2/E and 3/E C++ How to Program, 9/E and 10/E Java™ How to Program, 10/E and 11/E Simply C++: An App-Driven Tutorial Approach Simply Visual Basic 2010: An App-Driven Approach, 4/E ® ® ®
  • 7. Visual Basic 2012 How to Program, 6/E Visual C# How to Program, 6/E Visual C# 2012 How to Program, 5/E LiveLessons Video Learning Products http://deitel.com/books/LiveLessons/ Android™ 6 App Development Fundamentals, 3/E C++ Fundamentals Java SE 8™ Fundamentals, 2/E Java SE 9™ Fundamentals, 3/E C# 6 Fundamentals C# 2012 Fundamentals JavaScript Fundamentals Swift™ Fundamentals REVEL™ Interactive Multimedia ® ® ®
  • 8. REVEL™ for Deitel Java™ To receive updates on Deitel publications, Resource Centers, training courses, partner offers and more, please join the Deitel communities on Facebook —http://facebook.com/DeitelFan Twitter —http://twitter.com/deitel LinkedIn —http://linkedin.com/company/deitel-&- associates YouTube™—http://youtube.com/DeitelTV Google+™—http://google.com/+DeitelFan Instagram —http://instagram.com/DeitelFan and register for the free Deitel Buzz Online e-mail newsletter at: http://www.deitel.com/newsletter/subscribe.html To communicate with the authors, send e-mail to: [email protected] For information on programming-languages corporate training seminars offered by Deitel & Associates, Inc. worldwide, write to [email protected] or visit: http://www.deitel.com/training/ ® ® ® ® ®
  • 9. For continuing updates on Pearson/Deitel publications visit: http://www.deitel.com http://www.pearsonhighered.com/deitel/ Visit the Deitel Resource Centers, which will help you master programming languages, software development, Android™ and iOS app development, and Internet- and web-related topics: http://www.deitel.com/ResourceCenters.html ®
  • 10. Java™ How to Program Early Objects ELEVENTH EDITION Paul Deitel Deitel & Associates, Inc. Harvey Deitel Deitel & Associates, Inc. 330 Hudson Street, NY, NY, 10013
  • 11. Trademarks Deitel and the double-thumbs-up bug are registered trademarks of Deitel and Associates, Inc. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. Microsoft and/or its respective suppliers make no representations about the suitability of the information contained in the documents and related graphics published as part of the services for any purpose. All such documents and related graphics are provided “as is” without warranty of any kind. Microsoft and/ or its respective suppliers hereby disclaim all warranties and conditions with regard to this information, including all warranties and conditions of merchantability, whether express, implied or statutory, fitness for a particular purpose, title and non-infringement. In no event shall Microsoft and/or its respective suppliers be liable for any special, indirect or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortious action, arising out of or in connection with the use or performance of information available from the services. The documents and related graphics contained herein could include technical inaccuracies or typographical errors.
  • 12. Changes are periodically added to the information herein. Microsoft and/or its respective suppliers may make improvements and/or changes in the product(s) and/or the program(s) described herein at any time. Partial screen shots may be viewed in full within the software version specified. Microsoft and Windows are registered trademarks of the Microsoft Corporation in the U.S.A. and other countries. Screen shots and icons reprinted with permission from the Microsoft Corporation. This book is not sponsored or endorsed by or affiliated with the Microsoft Corporation. UNIX is a registered trademark of The Open Group. Apache is a trademark of The Apache Software Foundation. CSS and XML are registered trademarks of the World Wide Web Consortium. Firefox is a registered trademark of the Mozilla Foundation. Google is a trademark of Google, Inc. Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries. Linux is a registered trademark of Linus Torvalds. All trademarks are property of their respective owners. Throughout this book, trademarks are used. Rather than put a trademark symbol in every occurrence of a trademarked name, we state that we are using the names in an editorial fashion ® ®
  • 13. only and to the benefit of the trademark owner, with no intention of infringement of the trademark.
  • 14. Contents The online chapters and appendices listed at the end of this Table of Contents are located on the book’s Companion Website (http://www.pearsonhighered.com/ deitel/)—see the inside front cover of your book for details. 1. Foreword xxv 2. Preface xxvii 3. Before You Begin xlvii 1. 1 Introduction to Computers, the Internet and Java 1 1. 1.1 Introduction 2 2. 1.2 Hardware and Software 4 1. 1.2.1 Moore’s Law 4 2. 1.2.2 Computer Organization 5 3. 1.3 Data Hierarchy 7 4. 1.4 Machine Languages, Assembly Languages and High-Level Languages 9 5. 1.5 Introduction to Object Technology 10 1. 1.5.1 Automobile as an Object 11 2. 1.5.2 Methods and Classes 11 3. 1.5.3 Instantiation 11
  • 15. 4. 1.5.4 Reuse 11 5. 1.5.5 Messages and Methopd Calls 12 6. 1.5.6 Attributes and Instance Variables 12 7. 1.5.7 Encapsulation and Information Hiding 12 8. 1.5.8 Inheritance 12 9. 1.5.9 Interfaces 13 10. 1.5.10 Object-Oriented Analysis and Design (OOAD) 13 11. 1.5.11 The UML (Unified Modeling Language) 13 6. 1.6 Operating Systems 14 1. 1.6.1 Windows—A Proprietary Operating System 14 2. 1.6.2 Linux—An Open-Source Operating System 14 3. 1.6.3 Apple’s macOS and Apple’s iOS for iPhone , iPad and iPod Touch Devices 15 4. 1.6.4 Google’s Android 15 7. 1.7 Programming Languages 16 8. 1.8 Java 18 9. 1.9 A Typical Java Development Environment 19 10. 1.10 Test-Driving a Java Application 22 11. 1.11 Internet and World Wide Web 26 1. 1.11.1 Internet: A Network of Networks 27 2. 1.11.2 World Wide Web: Making the Internet User- Friendly 27 3. 1.11.3 Web Services and Mashups 27 4. 1.11.4 Internet of Things 28 12. 1.12 Software Technologies 29 ® ® ®
  • 16. 13. 1.13 Getting Your Questions Answered 31 2. 2 Introduction to Java Applications; Input/Output and Operators 35 1. 2.1 Introduction 36 2. 2.2 Your First Program in Java: Printing a Line of Text 36 1. 2.2.1 Compiling the Application 40 2. 2.2.2 Executing the Application 41 3. 2.3 Modifying Your First Java Program 42 4. 2.4 Displaying Text with printf 44 5. 2.5 Another Application: Adding Integers 45 1. 2.5.1 import Declarations 46 2. 2.5.2 Declaring and Creating a Scanner to Obtain User Input from the Keyboard 46 3. 2.5.3 Prompting the User for Input 47 4. 2.5.4 Declaring a Variable to Store an Integer and Obtaining an Integer from the Keyboard 47 5. 2.5.5 Obtaining a Second Integer 48 6. 2.5.6 Using Variables in a Calculation 48 7. 2.5.7 Displaying the Calculation Result 48 8. 2.5.8 Java API Documentation 49 9. 2.5.9 Declaring and Initializing Variables in Separate Statements 49 6. 2.6 Memory Concepts 49 7. 2.7 Arithmetic 50 8. 2.8 Decision Making: Equality and Relational Operators 54 9. 2.9 Wrap-Up 57
  • 17. 3. 3 Introduction to Classes, Objects, Methods and Strings 68 1. 3.1 Introduction 69 2. 3.2 Instance Variables, set Methods and get Methods 70 1. 3.2.1 Account Class with an Instance Variable, and set and get Methods 70 2. 3.2.2 AccountTest Class That Creates and Uses an Object of Class Account 73 3. 3.2.3 Compiling and Executing an App with Multiple Classes 76 4. 3.2.4 Account UML Class Diagram 76 5. 3.2.5 Additional Notes on Class AccountTest 78 6. 3.2.6 Software Engineering with private Instance Variables and public set and get Methods 78 3. 3.3 Account Class: Initializing Objects with Constructors 79 1. 3.3.1 Declaring an Account Constructor for Custom Object Initialization 80 2. 3.3.2 Class AccountTest: Initializing Account Objects When They’re Created 81 4. 3.4 Account Class with a Balance; Floating-Point Numbers 82 1. 3.4.1 Account Class with a balance Instance Variable of Type double 83 2. 3.4.2 AccountTest Class to Use Class Account 85 5. 3.5 Primitive Types vs. Reference Types 88 6. 3.6 (Optional) GUI and Graphics Case Study: A Simple GUI 88 1. 3.6.1 What Is a Graphical User Interface? 90
  • 18. 2. 3.6.2 JavaFX Scene Builder and FXML 90 3. 3.6.3 Welcome App—Displaying Text and an Image 90 4. 3.6.4 Opening Scene Builder and Creating the File Welcome.fxml 90 5. 3.6.5 Adding an Image to the Folder Containing Welcome.fxml 92 6. 3.6.6 Creating a VBox Layout Container 92 7. 3.6.7 Configuring the VBox 92 8. 3.6.8 Adding and Configuring a Label 92 9. 3.6.9 Adding and Configuring an ImageView 94 10. 3.6.10 Previewing the Welcome GUI 95 7. 3.7 Wrap-Up 96 4. 4 Control Statements: Part 1; Assignment, ++ and -- Operators 104 1. 4.1 Introduction 105 2. 4.2 Algorithms 105 3. 4.3 Pseudocode 106 4. 4.4 Control Structures 106 1. 4.4.1 Sequence Structure in Java 107 2. 4.4.2 Selection Statements in Java 108 3. 4.4.3 Iteration Statements in Java 108 4. 4.4.4 Summary of Control Statements in Java 108 5. 4.5 if Single-Selection Statement 109 6. 4.6 if…else Double-Selection Statement 110 1. 4.6.1 Nested if…else Statements 111 2. 4.6.2 Dangling-else Problem 112
  • 19. 3. 4.6.3 Blocks 112 4. 4.6.4 Conditional Operator (?:) 113 7. 4.7 Student Class: Nested if…else Statements 113 8. 4.8 while Iteration Statement 116 9. 4.9 Formulating Algorithms: Counter-Controlled Iteration 118 10. 4.10 Formulating Algorithms: Sentinel-Controlled Iteration 122 11. 4.11 Formulating Algorithms: Nested Control Statements 129 12. 4.12 Compound Assignment Operators 133 13. 4.13 Increment and Decrement Operators 134 14. 4.14 Primitive Types 137 15. 4.15 (Optional) GUI and Graphics Case Study: Event Handling; Drawing Lines 138 1. 4.15.1 Test-Driving the Completed Draw Lines App 138 2. 4.15.2 Building the App’s GUI 139 3. 4.15.3 Preparing to Interact with the GUI Programmatically 143 4. 4.15.4 Class DrawLinesController 145 5. 4.15.5 Class DrawLines—The Main Application Class 147 16. 4.16 Wrap-Up 149 5. 5 Control Statements: Part 2; Logical Operators 164 1. 5.1 Introduction 165 2. 5.2 Essentials of Counter-Controlled Iteration 165 3. 5.3 for Iteration Statement 166 4. 5.4 Examples Using the for Statement 170
  • 20. 1. 5.4.1 Application: Summing the Even Integers from 2 to 20 171 2. 5.4.2 Application: Compound-Interest Calculations 172 5. 5.5 do…while Iteration Statement 175 6. 5.6 switch Multiple-Selection Statement 176 7. 5.7 Class AutoPolicy Case Study: Strings in switch Statements 182 8. 5.8 break and continue Statements 185 1. 5.8.1 break Statement 185 2. 5.8.2 continue Statement 186 9. 5.9 Logical Operators 187 1. 5.9.1 Conditional AND (&&) Operator 187 2. 5.9.2 Conditional OR (||) Operator 188 3. 5.9.3 Short-Circuit Evaluation of Complex Conditions 189 4. 5.9.4 Boolean Logical AND (&) and Boolean Logical Inclusive OR (|) Operators 189 5. 5.9.5 Boolean Logical Exclusive OR (^) 190 6. 5.9.6 Logical Negation (!) Operator 190 7. 5.9.7 Logical Operators Example 191 10. 5.10 Structured-Programming Summary 193 11. 5.11 (Optional) GUI and Graphics Case Study: Drawing Rectangles and Ovals 198 12. 5.12 Wrap-Up 201 6. 6 Methods: A Deeper Look 212
  • 21. 1. 6.1 Introduction 213 2. 6.2 Program Units in Java 213 3. 6.3 static Methods, static Fields and Class Math 215 4. 6.4 Methods with Multiple Parameters 217 5. 6.5 Notes on Declaring and Using Methods 221 6. 6.6 Method-Call Stack and Activation Records 222 1. 6.6.1 Method-Call Stack 222 2. 6.6.2 Stack Frames 222 3. 6.6.3 Local Variables and Stack Frames 222 4. 6.6.4 Stack Overflow 223 7. 6.7 Argument Promotion and Casting 223 8. 6.8 Java API Packages 224 9. 6.9 Case Study: Secure Random-Number Generation 226 10. 6.10 Case Study: A Game of Chance; Introducing enum Types 231 11. 6.11 Scope of Declarations 236 12. 6.12 Method Overloading 238 1. 6.12.1 Declaring Overloaded Methods 238 2. 6.12.2 Distinguishing Between Overloaded Methods 239 3. 6.12.3 Return Types of Overloaded Methods 240 13. 6.13 (Optional) GUI and Graphics Case Study: Colors and Filled Shapes 240 14. 6.14 Wrap-Up 243 7. 7 Arrays and ArrayLists 257
  • 22. 1. 7.1 Introduction 258 2. 7.2 Arrays 259 3. 7.3 Declaring and Creating Arrays 260 4. 7.4 Examples Using Arrays 262 1. 7.4.1 Creating and Initializing an Array 262 2. 7.4.2 Using an Array Initializer 263 3. 7.4.3 Calculating the Values to Store in an Array 264 4. 7.4.4 Summing the Elements of an Array 265 5. 7.4.5 Using Bar Charts to Display Array Data Graphically 265 6. 7.4.6 Using the Elements of an Array as Counters 267 7. 7.4.7 Using Arrays to Analyze Survey Results 268 5. 7.5 Exception Handling: Processing the Incorrect Response 270 1. 7.5.1 The try Statement 270 2. 7.5.2 Executing the catch Block 270 3. 7.5.3 toString Method of the Exception Parameter 271 6. 7.6 Case Study: Card Shuffling and Dealing Simulation 271 7. 7.7 Enhanced for Statement 276 8. 7.8 Passing Arrays to Methods 277 9. 7.9 Pass-By-Value vs. Pass-By-Reference 279 10. 7.10 Case Study: Class GradeBook Using an Array to Store Grades 280 11. 7.11 Multidimensional Arrays 285 1. 7.11.1 Arrays of One-Dimensional Arrays 286 2. 7.11.2 Two-Dimensional Arrays with Rows of Different
  • 23. Lengths 286 3. 7.11.3 Creating Two-Dimensional Arrays with Array- Creation Expressions 287 4. 7.11.4 Two-Dimensional Array Example: Displaying Element Values 287 5. 7.11.5 Common Multidimensional-Array Manipulations Performed with for Statements 288 12. 7.12 Case Study: Class GradeBook Using a Two-Dimensional Array 289 13. 7.13 Variable-Length Argument Lists 295 14. 7.14 Using Command-Line Arguments 296 15. 7.15 Class Arrays 298 16. 7.16 Introduction to Collections and Class ArrayList 301 17. 7.17 (Optional) GUI and Graphics Case Study: Drawing Arcs 305 18. 7.18 Wrap-Up 308 8. 8 Classes and Objects: A Deeper Look 329 1. 8.1 Introduction 330 2. 8.2 Time Class Case Study 330 3. 8.3 Controlling Access to Members 335 4. 8.4 Referring to the Current Object’s Members with the this Reference 336 5. 8.5 Time Class Case Study: Overloaded Constructors 338 6. 8.6 Default and No-Argument Constructors 343 7. 8.7 Notes on Set and Get Methods 344 8. 8.8 Composition 345 9. 8.9 enum Types 348
  • 24. 10. 8.10 Garbage Collection 351 11. 8.11 static Class Members 351 12. 8.12 static Import 355 13. 8.13 final Instance Variables 356 14. 8.14 Package Access 357 15. 8.15 Using BigDecimal for Precise Monetary Calculations 358 16. 8.16 (Optional) GUI and Graphics Case Study: Using Objects with Graphics 361 17. 8.17 Wrap-Up 365 9. 9 Object-Oriented Programming: Inheritance 373 1. 9.1 Introduction 374 2. 9.2 Superclasses and Subclasses 375 3. 9.3 protected Members 377 4. 9.4 Relationship Between Superclasses and Subclasses 378 1. 9.4.1 Creating and Using a CommissionEmployee Class 378 2. 9.4.2 Creating and Using a BasePlusCommissionEmployee Class 383 3. 9.4.3 Creating a CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy 388 4. 9.4.4 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using protected Instance Variables 391 5. 9.4.5 CommissionEmployee–BasePlusCommissionEmployee Inheritance Hierarchy Using private Instance Variables 394
  • 25. 5. 9.5 Constructors in Subclasses 398 6. 9.6 Class Object 399 7. 9.7 Designing with Composition vs. Inheritance 400 8. 9.8 Wrap-Up 402 10. 10 Object-Oriented Programming: Polymorphism and Interfaces 407 1. 10.1 Introduction 408 2. 10.2 Polymorphism Examples 410 3. 10.3 Demonstrating Polymorphic Behavior 411 4. 10.4 Abstract Classes and Methods 413 5. 10.5 Case Study: Payroll System Using Polymorphism 416 1. 10.5.1 Abstract Superclass Employee 417 2. 10.5.2 Concrete Subclass SalariedEmployee 419 3. 10.5.3 Concrete Subclass HourlyEmployee 421 4. 10.5.4 Concrete Subclass CommissionEmployee 422 5. 10.5.5 Indirect Concrete Subclass BasePlusCommissionEmployee 424 6. 10.5.6 Polymorphic Processing, Operator instanceof and Downcasting 425 6. 10.6 Allowed Assignments Between Superclass and Subclass Variables 430 7. 10.7 final Methods and Classes 430 8. 10.8 A Deeper Explanation of Issues with Calling Methods from Constructors 431 9. 10.9 Creating and Using Interfaces 432 1. 10.9.1 Developing a Payable Hierarchy 434
  • 26. 2. 10.9.2 Interface Payable 435 3. 10.9.3 Class Invoice 435 4. 10.9.4 Modifying Class Employee to Implement Interface Payable 437 5. 10.9.5 Using Interface Payable to Process Invoices and Employees Polymorphically 439 6. 10.9.6 Some Common Interfaces of the Java API 440 10. 10.10 Java SE 8 Interface Enhancements 441 1. 10.10.1 default Interface Methods 441 2. 10.10.2 static Interface Methods 442 3. 10.10.3 Functional Interfaces 442 11. 10.11 Java SE 9 private Interface Methods 443 12. 10.12 private Constructors 443 13. 10.13 Program to an Interface, Not an Implementation 444 1. 10.13.1 Implementation Inheritance Is Best for Small Numbers of Tightly Coupled Classes 444 2. 10.13.2 Interface Inheritance Is Best for Flexibility 444 3. 10.13.3 Rethinking the Employee Hierarchy 445 14. 10.14 (Optional) GUI and Graphics Case Study: Drawing with Polymorphism 446 15. 10.15 Wrap-Up 448 11. 11 Exception Handling: A Deeper Look 455 1. 11.1 Introduction 456 2. 11.2 Example: Divide by Zero without Exception Handling 457 3. 11.3 Example: Handling ArithmeticExceptions and
  • 27. InputMismatchExceptions 459 4. 11.4 When to Use Exception Handling 465 5. 11.5 Java Exception Hierarchy 465 6. 11.6 finally Block 469 7. 11.7 Stack Unwinding and Obtaining Information from an Exception 473 8. 11.8 Chained Exceptions 476 9. 11.9 Declaring New Exception Types 478 10. 11.10 Preconditions and Postconditions 479 11. 11.11 Assertions 479 12. 11.12 try-with-Resources: Automatic Resource Deallocation 481 13. 11.13 Wrap-Up 482 12. 12 JavaFX Graphical User Interfaces: Part 1 488 1. 12.1 Introduction 489 2. 12.2 JavaFX Scene Builder 490 3. 12.3 JavaFX App Window Structure 491 4. 12.4 Welcome App—Displaying Text and an Image 492 1. 12.4.1 Opening Scene Builder and Creating the File Welcome.fxml 492 2. 12.4.2 Adding an Image to the Folder Containing Welcome.fxml 493 3. 12.4.3 Creating a VBox Layout Container 493 4. 12.4.4 Configuring the VBox Layout Container 494 5. 12.4.5 Adding and Configuring a Label 494 6. 12.4.6 Adding and Configuring an ImageView 495 7. 12.4.7 Previewing the Welcome GUI 497
  • 28. 5. 12.5 Tip Calculator App—Introduction to Event Handling 497 1. 12.5.1 Test-Driving the Tip Calculator App 498 2. 12.5.2 Technologies Overview 499 3. 12.5.3 Building the App’s GUI 501 4. 12.5.4 TipCalculator Class 508 5. 12.5.5 TipCalculatorController Class 510 6. 12.6 Features Covered in the Other JavaFX Chapters 515 7. 12.7 Wrap-Up 515 13. 13 JavaFX GUI: Part 2 523 1. 13.1 Introduction 524 2. 13.2 Laying Out Nodes in a Scene Graph 524 3. 13.3 Painter App: RadioButtons, Mouse Events and Shapes 526 1. 13.3.1 Technologies Overview 526 2. 13.3.2 Creating the Painter.fxml File 528 3. 13.3.3 Building the GUI 528 4. 13.3.4 Painter Subclass of Application 531 5. 13.3.5 PainterController Class 532 4. 13.4 Color Chooser App: Property Bindings and Property Listeners 536 1. 13.4.1 Technologies Overview 536 2. 13.4.2 Building the GUI 537 3. 13.4.3 ColorChooser Subclass of Application 539 4. 13.4.4 ColorChooserController Class 540
  • 29. 5. 13.5 Cover Viewer App: Data-Driven GUIs with JavaFX Collections 542 1. 13.5.1 Technologies Overview 543 2. 13.5.2 Adding Images to the App’s Folder 543 3. 13.5.3 Building the GUI 543 4. 13.5.4 CoverViewer Subclass of Application 545 5. 13.5.5 CoverViewerController Class 545 6. 13.6 Cover Viewer App: Customizing ListView Cells 547 1. 13.6.1 Technologies Overview 548 2. 13.6.2 Copying the CoverViewer App 548 3. 13.6.3 ImageTextCell Custom Cell Factory Class 549 4. 13.6.4 CoverViewerController Class 550 7. 13.7 Additional JavaFX Capabilities 551 8. 13.8 JavaFX 9: Java SE 9 JavaFX Updates 553 9. 13.9 Wrap-Up 555 14. 14 Strings, Characters and Regular Expressions 564 1. 14.1 Introduction 565 2. 14.2 Fundamentals of Characters and Strings 565 3. 14.3 Class String 566 1. 14.3.1 String Constructors 566 2. 14.3.2 String Methods length, charAt and getChars 567 3. 14.3.3 Comparing Strings 569 4. 14.3.4 Locating Characters and Substrings in Strings
  • 30. 573 5. 14.3.5 Extracting Substrings from Strings 575 6. 14.3.6 Concatenating Strings 576 7. 14.3.7 Miscellaneous String Methods 577 8. 14.3.8 String Method valueOf 578 4. 14.4 Class StringBuilder 579 1. 14.4.1 StringBuilder Constructors 580 2. 14.4.2 StringBuilder Methods length, capacity, setLength and ensureCapacity 581 3. 14.4.3 StringBuilder Methods charAt, setCharAt, getChars and reverse 582 4. 14.4.4 StringBuilder append Methods 583 5. 14.4.5 StringBuilder Insertion and Deletion Methods 585 5. 14.5 Class Character 586 6. 14.6 Tokenizing Strings 591 7. 14.7 Regular Expressions, Class Pattern and Class Matcher 592 1. 14.7.1 Replacing Substrings and Splitting Strings 597 2. 14.7.2 Classes Pattern and Matcher 599 8. 14.8 Wrap-Up 601 15. 15 Files, Input/Output Streams, NIO and XML Serialization 612 1. 15.1 Introduction 613 2. 15.2 Files and Streams 613
  • 31. 3. 15.3 Using NIO Classes and Interfaces to Get File and Directory Information 615 4. 15.4 Sequential Text Files 619 1. 15.4.1 Creating a Sequential Text File 619 2. 15.4.2 Reading Data from a Sequential Text File 622 3. 15.4.3 Case Study: A Credit-Inquiry Program 623 4. 15.4.4 Updating Sequential Files 628 5. 15.5 XML Serialization 628 1. 15.5.1 Creating a Sequential File Using XML Serialization 628 2. 15.5.2 Reading and Deserializing Data from a Sequential File 634 6. 15.6 FileChooser and DirectoryChooser Dialogs 635 7. 15.7 (Optional) Additional java.io Classes 641 1. 15.7.1 Interfaces and Classes for Byte-Based Input and Output 641 2. 15.7.2 Interfaces and Classes for Character-Based Input and Output 643 8. 15.8 Wrap-Up 644 16. 16 Generic Collections 652 1. 16.1 Introduction 653 2. 16.2 Collections Overview 653 3. 16.3 Type-Wrapper Classes 655 4. 16.4 Autoboxing and Auto-Unboxing 655 5. 16.5 Interface Collection and Class Collections 655
  • 32. 6. 16.6 Lists 656 1. 16.6.1 ArrayList and Iterator 657 2. 16.6.2 LinkedList 659 7. 16.7 Collections Methods 664 1. 16.7.1 Method sort 664 2. 16.7.2 Method shuffle 668 3. 16.7.3 Methods reverse, fill, copy, max and min 670 4. 16.7.4 Method binarySearch 672 5. 16.7.5 Methods addAll, frequency and disjoint 673 8. 16.8 Class PriorityQueue and Interface Queue 675 9. 16.9 Sets 676 10. 16.10 Maps 679 11. 16.11 Synchronized Collections 683 12. 16.12 Unmodifiable Collections 683 13. 16.13 Abstract Implementations 684 14. 16.14 Java SE 9: Convenience Factory Methods for Immutable Collections 684 15. 16.15 Wrap-Up 688 17. 17 Lambdas and Streams 694 1. 17.1 Introduction 695 2. 17.2 Streams and Reduction 697 1. 17.2.1 Summing the Integers from 1 through 10 with a for Loop 697
  • 33. 2. 17.2.2 External Iteration with for Is Error Prone 698 3. 17.2.3 Summing with a Stream and Reduction 698 4. 17.2.4 Internal Iteration 699 3. 17.3 Mapping and Lambdas 700 1. 17.3.1 Lambda Expressions 701 2. 17.3.2 Lambda Syntax 702 3. 17.3.3 Intermediate and Terminal Operations 703 4. 17.4 Filtering 704 5. 17.5 How Elements Move Through Stream Pipelines 706 6. 17.6 Method References 707 1. 17.6.1 Creating an IntStream of Random Values 708 2. 17.6.2 Performing a Task on Each Stream Element with forEach and a Method Reference 708 3. 17.6.3 Mapping Integers to String Objects with mapToObj 709 4. 17.6.4 Concatenating Strings with collect 709 7. 17.7 IntStream Operations 710 1. 17.7.1 Creating an IntStream and Displaying Its Values 711 2. 17.7.2 Terminal Operations count, min, max, sum and average 711 3. 17.7.3 Terminal Operation reduce 712 4. 17.7.4 Sorting IntStream Values 714 8. 17.8 Functional Interfaces 715 9. 17.9 Lambdas: A Deeper Look 716
  • 34. 10. 17.10 Stream<Integer> Manipulations 717 1. 17.10.1 Creating a Stream<Integer> 718 2. 17.10.2 Sorting a Stream and Collecting the Results 719 3. 17.10.3 Filtering a Stream and Storing the Results for Later Use 719 4. 17.10.4 Filtering and Sorting a Stream and Collecting the Results 720 5. 17.10.5 Sorting Previously Collected Results 720 11. 17.11 Stream<String> Manipulations 720 1. 17.11.1 Mapping Strings to Uppercase 721 2. 17.11.2 Filtering Strings Then Sorting Them in Case- Insensitive Ascending Order 722 3. 17.11.3 Filtering Strings Then Sorting Them in Case- Insensitive Descending Order 722 12. 17.12 Stream<Employee> Manipulations 723 1. 17.12.1 Creating and Displaying a List<Employee> 724 2. 17.12.2 Filtering Employees with Salaries in a Specified Range 725 3. 17.12.3 Sorting Employees By Multiple Fields 728 4. 17.12.4 Mapping Employees to Unique-Last-Name Strings 730 5. 17.12.5 Grouping Employees By Department 731 6. 17.12.6 Counting the Number of Employees in Each Department 732 7. 17.12.7 Summing and Averaging Employee Salaries 733
  • 35. 13. 17.13 Creating a Stream<String> from a File 734 14. 17.14 Streams of Random Values 737 15. 17.15 Infinite Streams 739 16. 17.16 Lambda Event Handlers 741 17. 17.17 Additional Notes on Java SE 8 Interfaces 741 18. 17.18 Wrap-Up 742 18. 18 Recursion 756 1. 18.1 Introduction 757 2. 18.2 Recursion Concepts 758 3. 18.3 Example Using Recursion: Factorials 759 4. 18.4 Reimplementing Class FactorialCalculator Using BigInteger 761 5. 18.5 Example Using Recursion: Fibonacci Series 763 6. 18.6 Recursion and the Method-Call Stack 766 7. 18.7 Recursion vs. Iteration 767 8. 18.8 Towers of Hanoi 769 9. 18.9 Fractals 771 1. 18.9.1 Koch Curve Fractal 772 2. 18.9.2 (Optional) Case Study: Lo Feather Fractal 773 3. 18.9.3 (Optional) Fractal App GUI 775 4. 18.9.4 (Optional) FractalController Class 777 10. 18.10 Recursive Backtracking 782 11. 18.11 Wrap-Up 782 19. 19 Searching, Sorting and Big O 791
  • 36. 1. 19.1 Introduction 792 2. 19.2 Linear Search 793 3. 19.3 Big O Notation 796 1. 19.3.1 O(1) Algorithms 796 2. 19.3.2 O(n) Algorithms 796 3. 19.3.3 O(n ) Algorithms 796 4. 19.3.4 Big O of the Linear Search 797 4. 19.4 Binary Search 797 1. 19.4.1 Binary Search Implementation 798 2. 19.4.2 Efficiency of the Binary Search 801 5. 19.5 Sorting Algorithms 802 6. 19.6 Selection Sort 802 1. 19.6.1 Selection Sort Implementation 803 2. 19.6.2 Efficiency of the Selection Sort 805 7. 19.7 Insertion Sort 805 1. 19.7.1 Insertion Sort Implementation 806 2. 19.7.2 Efficiency of the Insertion Sort 808 8. 19.8 Merge Sort 809 1. 19.8.1 Merge Sort Implementation 809 2. 19.8.2 Efficiency of the Merge Sort 814 9. 19.9 Big O Summary for This Chapter’s Searching and Sorting Algorithms 814 10. 19.10 Massive Parallelism and Parallel Algorithms 815 2
  • 37. 11. 19.11 Wrap-Up 815 20. 20 Generic Classes and Methods: A Deeper Look 821 1. 20.1 Introduction 822 2. 20.2 Motivation for Generic Methods 822 3. 20.3 Generic Methods: Implementation and Compile-Time Translation 824 4. 20.4 Additional Compile-Time Translation Issues: Methods That Use a Type Parameter as the Return Type 827 5. 20.5 Overloading Generic Methods 830 6. 20.6 Generic Classes 831 7. 20.7 Wildcards in Methods That Accept Type Parameters 838 8. 20.8 Wrap-Up 842 21. 21 Custom Generic Data Structures 846 1. 21.1 Introduction 847 2. 21.2 Self-Referential Classes 848 3. 21.3 Dynamic Memory Allocation 848 4. 21.4 Linked Lists 849 1. 21.4.1 Singly Linked Lists 849 2. 21.4.2 Implementing a Generic List Class 850 3. 21.4.3 Generic Classes ListNode and List 853 4. 21.4.4 Class ListTest 853 5. 21.4.5 List Method insertAtFront 855 6. 21.4.6 List Method insertAtBack 856 7. 21.4.7 List Method removeFromFront 856 8. 21.4.8 List Method removeFromBack 857
  • 38. 9. 21.4.9 List Method print 858 10. 21.4.10 Creating Your Own Packages 858 5. 21.5 Stacks 863 6. 21.6 Queues 866 7. 21.7 Trees 868 8. 21.8 Wrap-Up 875 22. 22 JavaFX Graphics and Multimedia 900 1. 22.1 Introduction 901 2. 22.2 Controlling Fonts with Cascading Style Sheets (CSS) 902 1. 22.2.1 CSS That Styles the GUI 902 2. 22.2.2 FXML That Defines the GUI—Introduction to XML Markup 905 3. 22.2.3 Referencing the CSS File from FXML 908 4. 22.2.4 Specifying the VBox’s Style Class 908 5. 22.2.5 Programmatically Loading CSS 908 3. 22.3 Displaying Two-Dimensional Shapes 909 1. 22.3.1 Defining Two-Dimensional Shapes with FXML 909 2. 22.3.2 CSS That Styles the Two-Dimensional Shapes 912 4. 22.4 Polylines, Polygons and Paths 914 1. 22.4.1 GUI and CSS 915 2. 22.4.2 PolyShapesController Class 916 5. 22.5 Transforms 919
  • 39. 6. 22.6 Playing Video with Media, MediaPlayer and MediaViewer 921 1. 22.6.1 VideoPlayer GUI 922 2. 22.6.2 VideoPlayerController Class 924 7. 22.7 Transition Animations 928 1. 22.7.1 TransitionAnimations.fxml 928 2. 22.7.2 TransitionAnimationsController Class 930 8. 22.8 Timeline Animations 934 9. 22.9 Frame-by-Frame Animation with AnimationTimer 937 10. 22.10 Drawing on a Canvas 939 11. 22.11 Three-Dimensional Shapes 944 12. 22.12 Wrap-Up 947 23. 23 Concurrency 963 1. 23.1 Introduction 964 2. 23.2 Thread States and Life Cycle 966 1. 23.2.1 New and Runnable States 967 2. 23.2.2 Waiting State 967 3. 23.2.3 Timed Waiting State 967 4. 23.2.4 Blocked State 967 5. 23.2.5 Terminated State 967 6. 23.2.6 Operating-System View of the Runnable State 968 7. 23.2.7 Thread Priorities and Thread Scheduling 968 8. 23.2.8 Indefinite Postponement and Deadlock 969
  • 40. 3. 23.3 Creating and Executing Threads with the Executor Framework 969 4. 23.4 Thread Synchronization 973 1. 23.4.1 Immutable Data 974 2. 23.4.2 Monitors 974 3. 23.4.3 Unsynchronized Mutable Data Sharing 975 4. 23.4.4 Synchronized Mutable Data Sharing—Making Operations Atomic 979 5. 23.5 Producer/Consumer Relationship without Synchronization 982 6. 23.6 Producer/Consumer Relationship: ArrayBlockingQueue 990 7. 23.7 (Advanced) Producer/Consumer Relationship with synchronized, wait, notify and notifyAll 993 8. 23.8 (Advanced) Producer/Consumer Relationship: Bounded Buffers 999 9. 23.9 (Advanced) Producer/Consumer Relationship: The Lock and Condition Interfaces 1007 10. 23.10 Concurrent Collections 1014 11. 23.11 Multithreading in JavaFX 1016 1. 23.11.1 Performing Computations in a Worker Thread: Fibonacci Numbers 1017 2. 23.11.2 Processing Intermediate Results: Sieve of Eratosthenes 1022 12. 23.12 sort/parallelSort Timings with the Java SE 8 Date/Time API 1028 13. 23.13 Java SE 8: Sequential vs. Parallel Streams 1031 14. 23.14 (Advanced) Interfaces Callable and Future 1033
  • 41. 15. 23.15 (Advanced) Fork/Join Framework 1038 16. 23.16 Wrap-Up 1038 24. 24 Accessing Databases with JDBC 1050 1. 24.1 Introduction 1051 2. 24.2 Relational Databases 1052 3. 24.3 A books Database 1053 4. 24.4 SQL 1057 1. 24.4.1 Basic SELECT Query 1058 2. 24.4.2 WHERE Clause 1058 3. 24.4.3 ORDER BY Clause 1060 5. 24.4.4 Merging Data from Multiple Tables: INNER JOIN 1062 1. 24.4.5 INSERT Statement 1063 2. 24.4.6 UPDATE Statement 1064 3. 24.4.7 DELETE Statement 1065 6. 24.5 Setting Up a Java DB Database 1066 1. 24.5.1 Creating the Chapter’s Databases on Windows 1067 2. 24.5.2 Creating the Chapter’s Databases on macOS 1068 3. 24.5.3 Creating the Chapter’s Databases on Linux 1068 7. 24.6 Connecting to and Querying a Database 1068 1. 24.6.1 Automatic Driver Discovery 1070 2. 24.6.2 Connecting to the Database 1070
  • 42. 3. 24.6.3 Creating a Statement for Executing Queries 1071 4. 24.6.4 Executing a Query 1071 5. 24.6.5 Processing a Query’s ResultSet 1072 8. 24.7 Querying the books Database 1073 1. 24.7.1 ResultSetTableModel Class 1073 2. 24.7.2 DisplayQueryResults App’s GUI 1080 3. 24.7.3 DisplayQueryResultsController Class 1080 9. 24.8 RowSet Interface 1085 10. 24.9 PreparedStatements 1088 1. 24.9.1 AddressBook App That Uses PreparedStatements 1089 2. 24.9.2 Class Person 1089 3. 24.9.3 Class PersonQueries 1091 4. 24.9.4 AddressBook GUI 1094 5. 24.9.5 Class AddressBookController 1095 11. 24.10 Stored Procedures 1100 12. 24.11 Transaction Processing 1100 13. 24.12 Wrap-Up 1101 25. 25 Introduction to JShell: Java 9’s REPL 1109 1. 25.1 Introduction 1110 2. 25.2 Installing JDK 9 1112 3. 25.3 Introduction to JShell 1112
  • 43. 1. 25.3.1 Starting a JShell Session 1113 2. 25.3.2 Executing Statements 1113 3. 25.3.3 Declaring Variables Explicitly 1114 4. 25.3.4 Listing and Executing Prior Snippets 1116 5. 25.3.5 Evaluating Expressions and Declaring Variables Implicitly 1118 6. 25.3.6 Using Implicitly Declared Variables 1118 7. 25.3.7 Viewing a Variable’s Value 1119 8. 25.3.8 Resetting a JShell Session 1119 9. 25.3.9 Writing Multiline Statements 1119 10. 25.3.10 Editing Code Snippets 1120 11. 25.3.11 Exiting JShell 1123 4. 25.4 Command-Line Input in JShell 1123 5. 25.5 Declaring and Using Classes 1124 1. 25.5.1 Creating a Class in JShell 1125 2. 25.5.2 Explicitly Declaring Reference-Type Variables 1125 3. 25.5.3 Creating Objects 1126 4. 25.5.4 Manipulating Objects 1126 5. 25.5.5 Creating a Meaningful Variable Name for an Expression 1127 6. 25.5.6 Saving and Opening Code-Snippet Files 1128 6. 25.6 Discovery with JShell Auto-Completion 1128 1. 25.6.1 Auto-Completing Identifiers 1129 2. 25.6.2 Auto-Completing JShell Commands 1130 7. 25.7 Exploring a Class’s Members and Viewing Documentation
  • 44. 1130 1. 25.7.1 Listing Class Math’s static Members 1131 2. 25.7.2 Viewing a Method’s Parameters 1131 3. 25.7.3 Viewing a Method’s Documentation 1132 4. 25.7.4 Viewing a public Field’s Documentation 1132 5. 25.7.5 Viewing a Class’s Documentation 1133 6. 25.7.6 Viewing Method Overloads 1133 7. 25.7.7 Exploring Members of a Specific Object 1134 8. 25.8 Declaring Methods 1136 1. 25.8.1 Forward Referencing an Undeclared Method— Declaring Method displayCubes 1136 2. 25.8.2 Declaring a Previously Undeclared Method 1136 3. 25.8.3 Testing cube and Replacing Its Declaration 1137 4. 25.8.4 Testing Updated Method cube and Method displayCubes 1137 9. 25.9 Exceptions 1138 10. 25.10 Importing Classes and Adding Packages to the CLASSPATH 1139 11. 25.11 Using an External Editor 1141 12. 25.12 Summary of JShell Commands 1143 1. 25.12.1 Getting Help in JShell 1144 2. 25.12.2 /edit Command: Additional Features 1145 3. 25.12.3 /reload Command 1145 4. 25.12.4 /drop Command 1146 5. 25.12.5 Feedback Modes 1146
  • 45. 6. 25.12.6 Other JShell Features Configurable with /set 1148 13. 25.13 Keyboard Shortcuts for Snippet Editing 1149 14. 25.14 How JShell Reinterprets Java for Interactive Use 1149 15. 25.15 IDE JShell Support 1150 16. 25.16 Wrap-Up 1150 1. Chapters on the Web 1166 2. A Operator Precedence Chart 1167 3. B ASCII Character Set 1169 4. C Keywords and Reserved Words 1170 5. D Primitive Types 1171 6. E Using the Debugger 1172 1. E.1 Introduction 1173 2. E.2 Breakpoints and the run, stop, cont and print Commands 1173 3. E.3 The print and set Commands 1177 4. E.4 Controlling Execution Using the step, step up and next Commands 1179 5. E.5 The watch Command 1181 6. E.6 The clear Command 1183 7. E.7 Wrap-Up 1186 7. Appendices on the Web 1187 8. Index 1189 1. Online Chapters and Appendices The online chapters and appendices are located on the book’s
  • 46. Companion Website. See the book’s inside front cover for details. 2. 26 Swing GUI Components: Part 1 3. 27 Graphics and Java 2D 4. 28 Networking 5. 29 Java Persistence API (JPA) 6. 30 JavaServer™ Faces Web Apps: Part 1 7. 31 JavaServer™ Faces Web Apps: Part 2 8. 32 REST-Based Web Services 9. 33 (Optional) ATM Case Study, Part 1: Object-Oriented Design with the UML 10. 34 (Optional) ATM Case Study, Part 2: Implementing an Object-Oriented Design 11. 35 Swing GUI Components: Part 2 12. 36 Java Module System and Other Java 9 Features 13. F Using the Java API Documentation 14. G Creating Documentation with javadoc 15. H Unicode® 16. I Formatted Output 17. J Number Systems 18. K Bit Manipulation 19. L Labeled break and continue Statements 20. M UML 2: Additional Diagram Types 21. N Design Patterns
  • 47. Foreword Throughout my career I’ve met and interviewed many expert Java developers who’ve learned from Paul and Harvey, through one or more of their college textbooks, professional books, videos and corporate training. Many Java User Groups have joined together around the Deitels’ publications, which are used internationally in university courses and professional training programs. You are joining an elite group. How do I become an expert Java developer? This is one of the most common questions I receive at talks for university students and at events with Java professionals. Students want to become expert developers—and this is a great time to be one. The market is wide open, full of opportunities and fascinating projects, especially for those who take the time to learn, practice and master software development. The world needs good, focused expert developers. So, how do you do it? First, let’s be clear: Software development is hard. But do not be discouraged. Mastering it opens the door to great opportunities. Accept that it’s hard,
  • 48. embrace the complexity, enjoy the ride. There are no limits to how much you can expand your skills. Software development is an amazing skill. It can take you anywhere. You can work in any field. From nonprofits making the world a better place, to bleeding-edge biological technologies. From the frenetic daily run of the financial world to the deep mysteries of religion. From sports to music to acting. Everything has software. The success or failure of initiatives everywhere will depend on developers’ knowledge and skills. The push for you to get the relevant skills is what makes Java How to Program, 11/e so compelling. Written for students and new developers, it’s easy to follow. It’s written by authors who are educators and developers, with input over the years from some of the world’s leading academics and professional Java experts—Java Champions, open-source Java developers, even creators of Java itself. Their collective knowledge and experience will guide you. Even seasoned Java professionals will learn and grow their expertise with the wisdom in these pages.
  • 49. How can this book help you become an expert? Java was released in 1995—Paul and Harvey had the first edition of Java How to Program ready for Fall 1996 classes. Since that groundbreaking book, they’ve produced ten more editions, keeping current with the latest developments and idioms in the Java software-engineering community. You hold in your hands the map that will enable you to rapidly develop your Java skills. The Deitels have broken down the humongous Java world into well-defined, specific goals. Put in your full attention, and consciously “beat” each chapter. You’ll soon find yourself moving nicely along your road to excellence. And with both Java 8 and Java 9 in the same book, you’ll have up-to-date skills on the latest Java technologies. Most importantly, this book is not just meant for you to read— it’s meant for you to practice. Be it in the classroom or at home after work, experiment with the abundant sample code and practice with the book’s extraordinarily rich and diverse collection of exercises. Take the time to do all that is in here and you’ll be well on your way to achieving a level of expertise that will challenge professional developers out there. After working with Java for more than 20 years, I can tell you that this is not an exaggeration.
  • 50. For example, one of my favorite chapters is Lambdas and Streams. The chapter covers the topic in detail and the exercises shine—many real-world challenges that developers will encounter every day and that will help you sharpen your skills. After solving these exercises, novices and experienced developers alike will deeply understand these important Java features. And if you have a question, don’t be shy—the Deitels publish their email address in every book they write to encourage interaction. That’s also why I love the chapter about JShell—the new Java 9 tool that enables interactive Java. JShell allows you to explore, discover and experiment with new concepts, language features and APIs, make mistakes—accidentally and intentionally—and correct them, and rapidly prototype new code. It may prove to be the most important tool for leveraging your learning and productivity. Paul and Harvey give a full treatment of JShell that both students and experienced developers will be able to put to use immediately. I’m impressed with the care that the Deitels always take care to accommodate readers at all levels. They ease you into difficult concepts and deal with the challenges that professionals will encounter in industry projects. There’s lots of information about Java 9, the important new Java release. You can jump right in and learn the latest Java features. If you’re still working with Java 8, you can ease into Java 9 at your own pace—be sure to begin with the extraordinary JShell coverage.
  • 51. Another example is the amazing coverage of JavaFX—Java’s latest GUI, graphics and multimedia capabilities. JavaFX is the recommended toolkit for new projects. But if you’ll be working on legacy projects that use the older Swing API, those chapters are still available to you. Make sure to dig in on Paul and Harvey’s treatment of concurrency. They explain the basic concepts so clearly that the intermediate and advanced examples and discussions will be easy to master. You will be ready to maximize your applications’ performance in an increasingly multi-core world. I encourage you to participate in the worldwide Java community. There are many helpful folks out there who stand ready to help you. Ask questions, get answers and answer your peers’ questions. Along with this book, the Internet and the academic and professional communities will help speed you on your way to becoming an expert Java developer. I wish you success! Bruno Sousa [email protected] Java Champion Java Specialist at ToolsCloud President of SouJava (the Brazilian Java Society) SouJava representative at the Java Community Process
  • 52. Exploring the Variety of Random Documents with Different Content
  • 53. regard have been conservative and therefore would not result in overestimates. The number of houses per village can sometimes be calculated rather closely from the number of house pits seen in the sites. That is, the houses can be calculated closely if the assumption is correct that four-fifths of the number of house pits in a site represents the number of simultaneously occupied houses. Admittedly, this figure is rather speculative, but the best opinions I have been able to get grant that it is probably conservative. A more serious possible source of error concerns the question of which and how many sites were simultaneously occupied. When there is a complete village count, I have excluded from consideration known summer villages, villages not on main salmon streams, and other villages of doubtful status. Even so, the villages run about one per mile along the salmon streams and the possibility presents itself of movement from site to site, perhaps in response to varying fishing conditions. If this was the practice, then the population estimates might have to be reduced by half or even more. But there is no concrete evidence to support such a theory and it is a fact that the Goddard material gives quite complete information of this kind. Therefore, if the present calculation is an overestimate, it is not a very great one. ESTIMATES BASED ON VILLAGE COUNTS Wailaki (Eel and North Fork).—The present list gives a total of 67 villages among the Eel River and North Fork Wailaki. For purposes of calculating population I have excluded 13 of them (nos. 6, 9, 16, 31, 38, 40, 51, 57, 58, 59, 61, 66, 67) because they are summer camps in the hills, rock shelters used only briefly, or specialized fish-drying camps. These places do not seem to have been used simultaneously with the main villages. This list appears to be a substantially complete count from Horseshoe Bend south, but it is clear that neither Merriam nor Goddard visited the area north of this, and the village count suffers as a result. There are about 16 river-miles south of Horseshoe Bend, including both the main Eel and North Fork, and there are 49 main villages on this stretch, yielding an average of 3.1 per river-mile. If we apply this figure to the 7 river-miles above Horseshoe Bend, we get 21.7 villages for that stretch rather than 5, as given by ethnographers. We may reduce this figure to 15, because this stretch of the river appears to offer a less desirable location (Goddard, 1923a, p. 107). This calculation gives a total of 69 villages for the entire group, considerably less than Cook's total of 87 (Cook, 1956, p. 104). The reason for the difference is that Cook bases his estimate on Goddard's data, with the territory of the Wailaki extending above Kekawaka Creek, whereas I have taken Kekawaka Creek as the boundary. The house count per site for this group must be extrapolated from Goddard's house-pit counts (1923a, pp. 103, 105) on the sites of two of the tribelets. This figure has been calculated by Cook, who takes Goddard's house-pit count for 20 sites as "92 pits." For two localities, however, Goddard specifies a certain number plus "several" others. "If we allow 4 to represent 'several,' in each of these, then the total number of pits is 100 and the average per site or village is 5.0" (Cook, 1956, p. 104). Cook then reduces the figure by 20 per cent to allow for the probability that not all the house pits represent
  • 54. simultaneously occupied houses. His average number of houses per site is 4, which would not appear to be an overestimate. If we take this figure, we have a total of 276 houses for the Wailaki as against Cook's figure of 348, which was based on a greater area. Cook takes 6 persons per house as the average density for the Wailaki. This figure is arrived at in several ways. The figure of 7.5 per house is well established for the Yurok and sets an upper limit for the Wailaki area. Goddard appears to have based his population estimate on a mean of 4.5 persons per house, almost certainly too low, and Cook compromised at 6 per house. This figure is supported by independent observation by Foster on the Round Valley Yuki (Cook, 1956, p. 107). The social organization and the habitat of the Yuki and Wailaki are nearly identical, so the population per house should be the same for both groups. Accepting the figure of 6 persons per house, we get a total population of 1,656 for the Eel Wailaki and the North Fork Wailaki, as compared with Cook's figure of 2,315 and Goddard's figure of between one and two thousand. Pitch Wailaki.—Goddard (1924) records 33 villages for the Pitch Wailaki. For two of the four tribelets, the count is virtually complete. For a third tribelet, the T'odannañkiyahañ, Goddard lists 6 villages and indicates that there were probably more (1924, p. 225). If, to allow for these possible villages, we add 5 to the total above, we get a total of 38 villages for three tribelets, or an average of 12.7 per tribelet. Although the fourth tribelet, the Tchokotkiyahañ, had a poorer habitat than the other three (Goddard, 1924, p. 222), we may assume that it had at least 8 villages, an estimate which is probably conservative in view of its extensive territory. We then get a total of 46 villages for the Pitch Wailaki. Goddard counted house pits in 22 village sites and got an average of 5 per site. If we reduce this to 4 to account for unoccupied pits, we have an estimate of 184 houses for the Pitch Wailaki, as against 172 estimated by Cook. On the basis of 6 persons per house this gives a population of 1,104 as against 1,032 by Cook and between 650 and 800 by Goddard. For all Wailaki combined we get a total of 2,760. Cook's figure is 3,350, Kroeber's is 1,000, and Goddard's is between 1,650 and 2,800—average of 2,225. The difference between the figure presented here and Cook's figure is mostly due to the adjustment I have made in the Wailaki boundary from the one used by Goddard. Mattole.—The village lists of Merriam and Goddard give a total of 42 villages for the Mattole. I have excluded 5 of these from calculation of population estimates, one because it is a summer camp and four others because the frequency appears too great, in places along the coast, to make simultaneous occupation likely. This leaves a total of 37, very likely a conservative estimate since Goddard gives a number of names of villages not located and therefore not included in our calculations. Cook estimates 6 houses per village for the Mattole on the basis of comparison with the Wiyot, Yurok, Tolowa, and Chilula. Goddard counted house pits for a few sites of the Mattole and they appear to average less than that. Not much reliance can be placed on this average, because the sample was very small. However, the number of houses per site is probably not as high as among the Yurok. I have compromised with a figure of 5.4, the same as the estimate for the Sinkyone, the eastern neighbors of the Mattole.
  • 55. Cook takes Kroeber's Yurok figure of 7.5 persons per house in calculating Mattole population. The social organization here is more nearly like that of the southern Athabascans, so I have used 6 per house. This figure gives a total population of 1,200 as against 840 figured by Cook for the Mattole exclusive of Bear River. The difference here is due to the fact that Goddard's village lists were not available to Cook. If they had been, he would have obtained a figure of 1,665, or nearly double his actual estimate. Lolangkok Sinkyone.—For the Sinkyone on the northern part of the South Fork of the Eel we have a nearly complete village count. South of Larabee Creek Goddard and Merriam give a total of 46 villages. North of Larabee Creek on the main Eel the village count is incomplete, but Merriam gives 8 place names. That these place names represent village names is clear from the Merriam place names farther south which can be checked against Goddard's data. Together, these give a total of 54 villages but leave out the areas of Bull Creek and the upper Mattole River. We may assume 5 villages in each of these, surely a conservative estimate in view of the density of sites on Salmon Creek and South Fork. We thus have an estimate of 64 villages for the Northern Sinkyone. Goddard counted house pits in 24 of the sites he recorded. They come to a total of 162 or 6.7 per village. If we reduce this by 20 per cent to account for unoccupied pits, we get an average of 5.4 houses per site or a total estimate of 346 houses among the Lolangkok Sinkyone. At 6 persons per house this estimate yields a total population of 2,076. Hupa.—In the present village list there are 11 villages in Hoopa Valley and 16 above the valley on the main Trinity and on South Fork. Of these sixteen, three have been rejected as being in Chimariko territory (nos. 25, 26, 27). Cook has argued, reasonably, it appears, that the villages in Hoopa Valley average 11 houses, whereas the villages above the valley average 4.5 houses each. This average gives a total of 193 houses for the Hupa. Cook has estimated that there is an average of 10 persons per house among the Hupa. This figure is arrived at by the following line of reasoning: according to a census taken in 1870 there was a total of 601 persons in 7 villages at that time, of which 232 were male and 359 were female. This count indicates a disproportionate number of males and Cook therefore calculates a population of twice the number of females, or 718, as a more normal population. Goddard's data give the number of houses for these villages as 92, a figure Cook takes as representing the situation in 1850. This combination yields an average of 7.8 persons per house. Since there had certainly been a decline in population between 1850 and 1870, Cook proposes that the figure for the density of population be raised to 10 persons per house. But Goddard does not say what period his figures represent, so I propose to follow a line of reasoning similar to that of Cook but to use different figures. The number of houses for 6 villages in 1851 is reported by Gibbs (see map, pl. 9). We may compare these to the 1870 population estimates as given by Kroeber (1925a, p. 131). If we adjust for male attrition by calculating population as twice the female population, or 640 (see table 1), we get a density per house of 7.8, exactly the same figure that Cook gets. TABLE 1 Hupa Population, 1870[1]
  • 56. Village Males Females Houses Honsading 25 30 9 Miskut 32 49 6 Takimitlding 51 74 20 Tsewenalding 14 31 10 Medilding 75 100 28 Djishtangading 14 36 9 Total 211 320 82 [1] Kroeber, 1925a, p. 131. That there was a decline in population between 1850 and 1870 is agreed by all authorities. This fact makes it very attractive to accept Cook's proposed density of 10 persons per house for the Hupa in aboriginal times. But there are two objections to this procedure. For one thing, the population figures for 1870 may be inaccurate. In the census of that year, there were reported 874 Indians of all tribes on the Hoopa Reservation (Kroeber, 1925a, p. 131). But in the same year another agent reported only 649 Indians on the reservation. This is a 25 per cent reduction, and if we reduce the population estimate of 640 by 25 per cent, we get 480 as the estimate for 1870 and a density per house of 5.9. If we raise the population of 480 to account for the 1850-1870 reduction, we are again close to the figure 7.5 persons per house. This calculation is presented merely to indicate that the figures are not reliable. The other objection to accepting Cook's proposed figure for density is that the established figure for the Yurok is 7.5 persons per house. According to Cook, this figure was based on an underlying assumption that "the social family in the usual monogamous tribe included the father, mother, children, and occasional close relatives" (Cook, 1956, p. 99). As a matter of fact, Kroeber's estimate is not based on this assumption but is an empirical estimate based on population counts and house counts (Kroeber, 1925a, pp. 16-19), and the figure is accepted wholeheartedly by Cook for the Yurok (1956, p. 83). But what is certainly clear is that the social organization, house type, and environment of the Hupa was virtually the same as that of the Yurok and therefore the population density per house must have been the same. It is therefore clear that we must accept either 7.5 persons per house or 10 persons per house as the population density for both the Hupa and the Yurok, and the question becomes one of comparing the reliability of the figures given for the Yurok with those given for the Hupa. Yurok figures appear to be intrinsically more reliable and are also earlier and I have therefore taken 7.5 persons per house as the density. The population for the Hupa then comes to 1,475 as compared to 2,000 estimated by Cook and to less than 1,000 estimated by Kroeber. Whilkut.—The number of permanent villages among the Whilkut has been estimated here at 69. This estimate excludes known summer camps and other villages away from the main salmon streams. For the Chilula Whilkut there are 23 villages. For the Kloki Whilkut there are 16 villages, including several which are not shown on the map but which are listed by Merriam as being on upper Redwood Creek. Ten villages have been taken from
  • 57. the North Fork Whilkut. Twenty villages are taken from the Mad River Whilkut even though only 16 are given in the village lists. Wherever both Merriam and Goddard worked the same area the latter has recorded substantially more villages than the former. I have therefore added 4 to the village count to make up for the presumptive lack, thus bringing the total up to 69. House-pit counts from the Chilula Whilkut are listed for six villages by Kroeber (1925a, p. 138) as 17, 7, 4, 2, 4, 8, or an average of 7 per village. Kroeber reduces this average by a third, on the basis of his estimates for the Yurok and Hupa, to arrive at a figure of 5 houses per village. Cook (1956, p. 84) says the reduction should be only about 10 per cent, calculated on the basis of Waterman's study of the Yurok (Waterman, 1920), and he compromises, making a reduction of a seventh to use 6 as an average number of houses per village. The sample used by Kroeber and Cook is so small that an estimate based on it of the average number of house pits per village is liable to considerable error. If we look at the figures for some of the surrounding groups, we find an estimate of 11 houses per village for the Hupa in Hoopa Valley, 4.5 for the Hupa outside the valley, 4 for the Wailaki, 4.5 for the Wiyot (Cook, 1956, p. 102), and 5.4 for the Lolangkok Sinkyone. The Whilkut terrain and culture is certainly more nearly like the region outside Hoopa Valley than inside it, so we are scarcely justified in estimating more than 5 houses per village. On this basis we get a total of 345 houses for the Whilkut. Both Kroeber and Cook use the Yurok figure of 7.5 persons per house in calculating the population of this group. This figure may well be too high, and perhaps it should be more nearly the same as the estimate for the southern groups, but since I have no concrete evidence to support such a contention, I have also used the Kroeber and Cook figure. This gives a total population of 2,588 for the Whilkut. Cook's figures for the groups which were formerly listed under the Chilula and Whilkut were 800 and 1,300 making a total of 2,100. Kroeber's figures were 600 and 400 for a total of 1,000. The difference between Cook's figures and those given here is partly due to the fact that Cook took the group on the North Fork of the Mad to be Wiyot, whereas I have them as Whilkut. Also Cook made a reduction of a ninth in his Mad River estimates because of the poor environment there. I have not done this because the Mad River region does not seem to me noticeably poorer than that along Redwood Creek. ESTIMATES BASED ON FISH RESOURCES For the six tribes just discussed, the ethnographic notes at our disposal offer a means of estimating the population, but we have also another basis for our calculations. Fishery was the most important single factor in the California Athabascan economy, hence the fish resources of the region undoubtedly exerted a marked influence on population size. Therefore, before attempting to estimate the population of the remaining groups, for which we have scanty ethnographic information, I would like to present some data on the fish resources of the region.
  • 58. I have attempted to calculate the number of stream miles of fishing available and thereby to form some estimate of the economic basis of each of the groups. Most of my information comes from Mr. Almo J. Cordone, Junior Aquatic Biologist of the California Department of Fish and Game, who was kind enough to gather the relevant data from the records of that organization. I have not included material on the freshwater trout, which was apparently too scarce to be important, or on the lamprey eel, on which we do not have sufficient information, although it was of some importance, especially in the Eel River and its tributaries. The available stream miles of fishing may seem insufficient material on which to base estimates of fish resources and unquestionably it would be desirable to have some idea of the fish population per mile of stream in order to estimate the food value of the resources available to the people. On the other hand, this point may not be as crucial as it seems, for apparently the fish population was not a governing factor in the number of fish taken by the Indians. According to Rostlund (1952, p. 17), the aboriginal fishermen of California did not even approach overfishing. If this is so, then there must have been fish left uncaught even in the smaller salmon streams and it would therefore seem that one stream was nearly as good as another, if it carried salmon at all. An exception would be the Trinity River and its tributaries, the only streams in the Athabascan area with both spring and fall runs of salmon. In other streams there is only a fall run. The lists that follow include data, not only for the six tribes previously discussed (Wailaki, Pitch Wailaki, Mattole, Lolangkok Sinkyone, Hupa, and Whilkut), but also for the Nongatl, Kato, Shelter Cove Sinkyone, Lassik, and Bear River groups. The fish species is recorded, when it is known; when our source gives no identification of species, however, the generic term is used. Available Stream Miles for Fishing in Tribal Territory KATO 29 mi. South Fork Eel R.—19 mi. Quantities of steelhead and silver salmon go up at least to Branscomb and King salmon go at least to Ten Mile Cr. (Dept. of Fish and Game). Hollow Tree Cr.—5 mi. There was fishing on this stream (Gifford, 1939, p. 304). Fish not specified, probably steelhead and salmon. Ten Mile Cr.—5 mi. This stream appears to be large enough for salmon and there were villages on it. Also the Fish and Game information for South Fork implies fish in the stream. WAILAKI (Eel R. and North Fork Wailaki) 23 mi. Eel R.—16 mi. There are good runs of salmon as far up as Lake Pillsbury (Dept. of Fish and Game). North Fork Eel—7 mi. Salmon go up North Fork farther than 7 mi. (see Pitch Wailaki). PITCH WAILAKI 15 mi.
  • 59. North Fork Eel—12 mi. See below. Casoose and Hulls creeks—3 mi. The Dept of Fish and Game states that salmon do not ascend North Fork above Asbill Cr. but Goddard's informant (see Pitch Wailaki Village no. 21) said that fish got up into Hulls and Casoose creeks, the mouths of which are above Asbill Cr. The Dept. of Fish and Game information may refer to a more recent situation. LASSIK 25 mi. Eel R.—17 mi. (See Wailaki.) Dobbyn Cr.—8 mi. There would seem to have been fish in Dobbyn Cr., since it is a fair-sized stream and there were many villages on it. SHELTER COVE SINKYONE 67 mi. South Fork Eel—39 mi. There were a good many fish in South Fork as far up as Branscomb (Dept. of Fish and Game). Redwood Cr.—5 mi. According to Merriam the region around Redwood Cr. was a center for the Shelter Cove Sinkyone; therefore there must have been fish in the creek. Mattole R.—11 mi. There is a partial barrier to salmon at the community of Thorn but some fish get up even beyond this (Dept. of Fish and Game). East Branch, South Fork Eel—4 mi. King salmon and silver salmon go up at least to Squaw Cr. (3 mi.) and steelhead go up at least to Rancheria Cr. (4.5 mi., according to the Dept. of Fish and Game). Sea Coast—8 mi. The Shelter Cove Sinkyone have 16 mi. of sea coast. The only reliable data on the density of sea coast population in relation to the riverine population are given by Kroeber (1925a, p. 116). According to his figures, the seashore is about half as productive as the rivers and I have therefore halved the sea coast mileage in the calculation of available fishing miles. LOLANGKOK SINKYONE 63 mi. Eel R.—27 mi. (See Wailaki.) South Fork Eel R.—16 mi. (See Kato.) Bull Cr.—6 mi. According to Merriam, there was a large settlement on Bull Cr. It could not have been supported without fish. Salmon Cr.—5 mi. Goddard mentions fishing on at least part of this stream. Mattole R.—10 mi. The fish go beyond this stretch at least as far as Thorn (Dept. of Fish and Game). MATTOLE 38.5 mi.
  • 60. Mattole R.—25 mi. The fish go considerably beyond here in the Mattole. North Fork Mattole—5 mi. North Fork is a sizable stream and there were several villages along it, so it probably had fish in it. Sea Coast—8.5 mi. The Mattole have 17 mi. of sea coast. This has been halved in accordance with the principle stated above. BEAR RIVER 21 mi. Bear R.—18 mi. This figure is rather arbitrary since the information is poor for this stream. It is known that silver salmon and steelhead are caught there and that there is a fall run of King salmon (Dept. of Fish and Game). Sea Coast—3 mi. The Bear River group has 6 mi. of sea coast, halved for present purposes. NONGATL 85 mi. Van Duzen R.—40 mi. Steelhead go up as far as Eaton Roughs (40 mi.). Silver salmon go up as far as Grizzly Cr. (21 mi.) and probably as far as Eaton Roughs. There are no data on King salmon but it is known that there is a fall run of them here. Information from Dept. of Fish and Game. Eel R.—5 mi. All 5 mi. of the Eel in Nongatl territory should provide excellent fishing. Larabee Cr.—20 mi. There is no direct information on this stream, but it is of considerable size and there were many villages at least 20 mi. up. Yager Cr.—20 mi. Again we have no direct information but there are many villages far up on this stream. Twenty miles of available fishing is probably a conservative estimate. Mad R.—0 mi. There is a long stretch of Mad R. in Nongatl territory but, according to the Dept. of Fish and Game, no fish go up so far. WHILKUT 70 mi. Mad R.—27 mi. There is a 12-ft. falls at Bug Cr. which represents a nearly complete barrier to salmon. This means that there are salmon in nearly all the territory of the Mad R. Whilkut. North Fork Mad R.—8 mi. According to Merriam, there were fishing camps nearly this far up on North Fork. Redwood Cr.—35 mi. There is no direct information on this stream. I have attributed salmon to nearly its whole length because of the size of the stream and the large number of villages along its upper course. HUPA 39 mi. Trinity R.—27 mi. There are fish in this whole stretch (Dept. of Fish and Game).
  • 61. South Fork Trinity—12 mi. There are known to be salmon in South Fork, and presumably they go up as far as the border of Hupa territory. TABLE 2 Area, Fishing Miles, and Population Estimates Tribe[2] Pop. Estimate Area Ln Area Fishing Miles Ln Fishing Miles Wailaki 1,656 296 5.69 23 3.14 Pitch Wailaki 1,104 182 5.20 15 2.71 Mattole 1,200 170 5.14 38.5 3.65 Lolangkok Sinkyone 2,076 294 5.68 63 4.14 Hupa 1,475 424 6.05 39 3.66 Whilkut 2,588 461 6.13 70 4.25 Average 1,683 5.65 3.59 [2] Relatively complete village counts. TABLE 3 Area and Fishing Miles Tribe[3] Area Ln Area Fishing Miles Ln Fishing Miles Kato 225 5.42 29 3.37 Bear River 121 4.80 21 3.04 Lassik 389 5.96 25 3.22 Nongatl 855 6.75 85 4.44 Shelter Cove Sinkyone 350 5.86 67 4.20 [3] Incomplete village counts. GROSS ESTIMATE From the preceding data we have obtained population estimates for certain of the California Athabascan groups. If these estimates are judged reliable, it would be desirable to use them as a basis for estimating the population of the remaining groups. When a detailed analysis of the ecological or demographical factors involved is lacking, it is sometimes necessary to fall back on rather simplistic assumptions to attain the desired end. Cook goes rather far in this direction, using simply the average population density per square mile of the known groups to estimate the population of the unknown groups. It appears to this writer that a somewhat more satisfactory method of estimation would be based on simple linear regression theory. It is a fact that pertinent relationships in population studies can often be expressed in terms of simple exponential functions or in
  • 62. linear combinations of logarithms. Thus we might propose a relationship such as the following: population = a + b (ln area) or population = a + b (ln fishing miles) where a and b are constants to be determined and ln is the logarithm to the base e. Of course we would not expect these relationships to be precise. The lack of exactness might be due to the crudeness of the various measurements involved or perhaps to the fact that population depends on more than one such factor. To account in some way for the uncertainty, we might make a further assumption and propose the following relationships: population = a + b (ln area) + X population = a + b (ln fishing miles) + X where X has a normal probability distribution with mean = 0 and some unknown variance = σ2 . X is then, roughly speaking, the error involved in each observation. That the error would be distributed normally is quite reasonable under the circumstances. In situations where the uncertainty of the observation is due to measurement error or to a multiplicity of factors, the distribution obtained often assumes a normal form or a form sufficiently normal so that the normal distribution can be used as an approximation. One additional assumption is necessary. We must assume that the sample used is taken in a random fashion from the population to be studied. In the present investigation, the sample is definitely not taken at random, since we are using all groups for which we have population estimates based on ethnographic information. The question is, then, whether this selection of groups would result in some bias. For instance, the groups for which we have ethnographic data might be the most numerous in the first place and might thus cause us overestimate the population of the remaining groups. On the whole, it would seem to me that there is no such bias and that the assumption of a random sample is therefore not misleading, at least in the direction of overestimation. If we now consider each group for which we have no ethnographic data, we can see whether the lack of such data is due to an initially small population or to mere luck. Kato: The reason Kato population is being estimated in gross rather than from ethnographic data is that Goddard (1909, p. 67) obtained a list of more than 50 villages which are not available for calculation. Bear River: Here the lack of information is due simply to the fact that it was not collected. There have been several informants living until recently (see Nomland, 1938). Lassik: There was at least one good informant living until recently (Essene, 1942), but Merriam worked with her only briefly. Goddard evidently recorded a number of villages from this group, but his notes are lost.
  • 63. Nongatl: Goddard seems to have worked with at least two informants from this group, but he spent a very brief time in the area and some of his notes may have been lost. Shelter Cove Sinkyone: Several informants from this group have been alive until recently (see Nomland, 1935). No one saw fit to collect the appropriate data. It is obvious from this summary that the main reason for our lack of information on these groups is the loss of Goddard's notes. If those were at hand, we would probably have complete information on the Kato, the Lassik, and probably the Nongatl. The absence of data on the Bear River and Shelter Cove Sinkyone is due to the ethnographers' oversight. None of these groups, therefore, seem to have been selected because of their small aboriginal population. If the following estimates are in error because the sample is not a random one, then the error is probably one of underestimate rather than overestimate. Given the foregoing assumptions, the least squares estimate of the normal regression line may be obtained with the following formula. P: population. A: area. F: fishing miles. The equations of the lines are: P = a + b (ln A) P = a' + b' (ln F) the estimate of b is (Bennett and Franklin, 1954, p. 224) Σ(Xi − X̅)(Yi − Y̅) b̂ = ------------------------------------ Σ(Xi − X)2 and of a is â = Y̅ − b̂ X̅ where Xi = ln A for each group with known population and Yi = P for each known group. Similarly the estimate of b' is Σ(Xi − X̅)(Yi − Y̅) b̂' = ---------------------------------- Σ(Xi − X̅)2 and of a' is â' = Y̅ − b̂ 'X̅ where Xi = ln F for each known group and Yi = P for each known group. These calculations are shown in table 4. TABLE 4
  • 64. Calculation of Regression Lines Shown in Figure 2 Fishing Miles (Xi − X̅ ) (Yi − Y̅ ) (Xi − X̅ )·(Yi − Y̅ ) (Xi − X̅ )2 -.452 -.027 .012 .204 -.882 -.579 .511 .778 .058 -.483 -.028 .003 .548 .393 .215 .300 .068 -.208 -.014 .005 .658 .905 .595 .433 Total. ... ... 1.291 1.723 Area (Xi − X̅ ) (Yi − Y̅ ) (Xi − X̅ )·(Yi − Y̅ ) (Xi − X̅ )2 .041 -.027 -.001 .002 -.445 .579 .258 .198 -.514 -.483 .248 .264 .034 .393 .013 .001 .400 -.208 -.083 .160 .484 .905 .438 .234 Total. ... ... .873 .859 The results are the following equations, which are shown, together with the points from which they were calculated, on figure 2. P = 1.02 (ln A) − 4.06 P = .75 (ln F) − 1.00 Thus, given either the area of a group or the fishing miles of a group habitat, we may estimate its population. From the diagram in figure 2 it appears that the estimates based on area have greater dispersion than those based on fishing miles and are therefore less reliable. This fact can best be made precise by using the above assumptions to obtain the confidence intervals for each of the estimates. The confidence intervals for the area estimates are given by the following formula (Bennett and Franklin, 1954, p. 229). {1 (Xo − X̅)2 } 1.02 Xo − 4.06 ± t∝Sa × √{- + -----------} {6 Σ(Xi − X̅)2 } where the symbols have the following values and meanings: [10.6] Xo: the log of the area of the group for which the population is being estimated.
  • 65. Xi: the log of the area of each of the groups for which the population is already known. X̅ : the average of the Xi. t∝: the upper ∝-point of the t-distribution (Bennett and Franklin, 1954, p. 696) where 1-∝ is the confidence coefficient. {1 } Sa = √{- × Σ(Yi + 4.06 − 1.02Xi)2 } {4 } where Yi is the population of each of the groups for which population is known. This is the estimated standard deviation of population where the estimate is made from area. Fig. 2. Simple linear regression of population. a. Regression of population on ln area. b. Regression of population on ln fishing miles. The confidence intervals for the fishing-mile estimates may be obtained in similar fashion —simply substituting the words fishing mile for area and Sf for Sa. For calculating the confidence intervals for area we have the following quantities: X̅ = 5.56 t.2 = 1.533 Σ(Xi − X̅ )2 = .859 Sa = .3594 The calculations are shown in table 5. The comparable quantities in calculating the confidence intervals for fishing-mile estimates are:
  • 66. X̅ = 3.70 t.2 = 1.533 Σ(Xi − X̅ )2 = .932 Sf = .394 The calculations are shown in table 6. TABLE 5 Calculation of Confidence Intervals for Area Tribe Xo (Xo − X̅ ) (Xo − X̅ )2 ------------- -- Σ((Xi − X̅ )2 ) { (Xo − X̅ )2 } √{1/6 + ------------ ----} { Σ((Xi − X̅ )2 )} { (Xo − X̅ )2 } t.2Sa × √{1/6 + ---------- ------} { Σ((Xi − X̅ )2 )} Kato 5.42 -.23 .0616 .4778 .263 Bear River 4.80 -.83 .8510 1.0088 .556 Lassik 5.96 .31 .1119 .5278 .291 Nongatl 6.75 1.10 1.4086 1.2551 .692 Shelter Cove Sinkyone 5.86 .21 .0513 .4669 .257 TABLE 6 Calculation of Fishing-Mile Estimates Tribe Xo (Xo − X̅ ) (Xo − X̅ )2 ------------- -- Σ((Xi − X̅ )2 ) { (Xo − X̅ )2 } √{1/6 + ------------ ----} { Σ((Xi − X̅ )2 )} { (Xo − X̅ )2 } t.2Sf × √{1/6 + ---------- ------} { Σ((Xi − X̅ )2 )} Kato 3.37 -.22 .0281 .4414 .267 Bear River 3.04 -.55 .1756 .5851 .353 Lassik 3.22 -.37 .0795 .4962 .300 Nongatl 4.44 .85 .4193 .7655 .462
  • 67. Shelter Cove Sinkyone 4.20 .67 .2160 .6186 .374 The results of the calculations are given in table 7. The figures are point estimates with 80 per cent confidence intervals. This means that under the assumptions given earlier we expect that the tabled intervals will contain the true population 8 times out of 10. I have accepted the estimates derived from fishing miles because their confidence intervals are a bit shorter on the average. TABLE 7 Population Estimates and Confidence Intervals Tribe Fishing-mile Estimate Area Estimate Kato 1,523 ± 267 1,470 ± 263 Bear River 1,276 ± 353 840 ± 556 Lassik 1,411 ± 300 2,020 ± 291 Nongatl 2,325 ± 462 2,830 ± 692 Shelter Cove Sinkyone 2,145 ± 374 1,920 ± 257 The question of whether the fishing-mile estimates yield shorter confidence intervals than the area estimates brings up an entire range of problems pertaining to economy, settlement pattern, and the like. The obvious interpretation of the shorter confidence intervals would be that the economy of the people in question depended more on fish and fishing than on the general produce over the whole range of their territory. The question then becomes one of quantitative expression—we would like to have some index of the extent of dependence on various factors in the economy. This might best be approached from the standpoint of analysis of covariance, where we would obtain the "components of variance." This technique is a combination of the methods of regression used in this paper and those of the analysis of variance. It would evidently yield sound indices of economic components, but it involves, for myself at least, certain problems of calculation and interpretation which will have to be resolved in the future. Another problem of this kind turns on the question of which factors are important in which area. Considering the State of California, for instance, we might want to know about such factors as deer population, water supply, the quantity of oak trees, etc. Any one of these factors or any combination of them might be important in a particular area; the problem of gathering the pertinent information then becomes crucial. Moreover, because the situation has changed since aboriginal times, we must combine modern information with available historic sources. S. F. Cook has shown that energetic and imaginative use of these sources yields very good results (e.g., Cook, 1955). Finally, there is the problem of the assumptions we were required to make in order to obtain our population estimates. Although many of the assumptions in the present paper are difficult to assess, the two which I would like to discuss here were particularly
  • 68. unyielding—the assumptions of the number of persons per house and the assumptions of the number of houses per village. The question of how many persons there were per house has been dealt with extensively by both Kroeber and Cook. There is also a great deal of random information in the ethnographic and historical literature. I believe there are enough data now at hand to provide realistic limits within which we could work, at least for the State of California. This information should be assembled and put into concise and systematic form so that it would be available for use in each area. It would also be of interest in itself from the standpoint of social anthropology. For the number of houses per village we have also a considerable body of information, but here we are faced with a slightly different problem. It often happens that we know, from ethnographic information or from archaeological reconnaissance, how many house pits there are in a village site but do not know how many of the houses which these pits represent were occupied simultaneously. In the present paper it has been assumed that four-fifths of the house pits represents the number of houses in the village occupied at any one time. This, however, is simply a guess, and one has no way of knowing how accurate a guess. The solution to this problem is simple but laborious. From each area of the State a random sample of villages with recorded house counts should be taken. Each of these village sites should then be visited and the house pits counted. A comparison of the two sets of figures would give us a perfectly adequate estimate, which could then be used subsequently over the entire area. TABLE 8 Population Estimates Tribe Area (sq. mi.) Fishing Miles Pop. Estimate Area Density Fishing- mile Density Kroeber[5] Estimate Cook[6] Estimate Kato[4] 225 29 1,523 6.77 52.5 500 1,100 Wailaki 296 23 1,656 5.59 72.0 600 2,315 Pitch Wailaki 182 15 1,104 6.07 73.6 400 1,032 Lassik[4] 389 25 1,411 3.63 56.4 500 1,500 Shelter Cove Sinkyone[4] 350 67 2,145 6.13 32.0 375 1,450 Lolangkok 294 63 2,076 7.06 33.0 375 1,450 Sinkyone Mattole 170 38.5 1,200 7.06 31.2 350 840 Bear River[4] 121 21 1,276 10.55 60.8 150 360 Nongatl[4] 855 85 2,325 2.72 27.4 750 3,300 Whilkut 461 70 2,588 5.61 37.0 1,000 2,100 Hupa 424 39 1,475 3.48 37.8 1,000 2,000
  • 69. Total 3,767 475.5 18,779 4.99 39.5 6,000 17,447 [4] The population figures for these groups are estimated in the gross by the method indicated in the text. [5] Kroeber, 1925a, p. 883. The breakdown has been changed somewhat to accommodate boundary changes; the total remains the same. The population density, according to Kroeber's figures, is 1.6 persons per sq. mi. [6] Cook, 1956. The breakdown has been changed somewhat to accommodate boundary changes; the total remains the same. The population density, according to Cook's figures, is 4.6 persons per sq. mi. The corpus of information provided by the methods outlined above would be useful in two ways. First, it would clarify our definitions of the economic factors in the lives of hunter-gatherers. Functional hypotheses which postulate dependence of social factors on economy would be subject to objective, quantitative tests of their validity. Second, the corpus of information would afford a suitable basis for inference from archaeological data. If we can determine what were the major economic factors in the lives of a prehistoric people, then we can make assertions about population, settlement pattern, and the like. Conversely, information about population and settlement pattern would imply certain facts about the economy. This technique has already been developed to some extent. For instance, Cook and Heizer, depending on assumptions derived from ethnographic data (Cook and Treganza, 1950; Heizer, 1953; Heizer and Baumhoff, 1956), have made inferences concerning village populations. These methods have such great possibilities for the conjunctive approach in archaeology that their use should be extended as much as possible.
  • 70. APPENDIXES APPENDIX I: THE TOLOWA The Tolowa are an Athabascan group living on the coast from a short distance north of the mouth of the Klamath River to the Oregon-California boundary. Information on this group has not been included in the main body of the paper because the Tolowa are separated from the other California Athabascan groups and belong more properly with the Oregon Athabascans; It was thought, however, that Merriam's data on the Tolowa should be recorded and they have therefore been appended in this form. The following passages are taken verbatim from Merriam's notes. HAH-WUN-KWUT NOTES The following notes are from information given me by Sam Lopez and wife and Lopez' father at the Mouth of Smith River, Del Norte County, Sept. 16-17, 1923. Name.—The tribe as a whole had no distinctive name for themselves except Huss, the word for people. But they had definite names for village areas. Those living at the mouth of Smith River call themselves Hah´-wun-kwut; those at Burnt Ranch, about three miles south of the mouth of Smith River, Yahnk´-tah-kut; those at Crescent City Tah-ah´-ten— and so on. Location, boundaries, and neighbors.—The territory of the tribe as a whole extends from Winchuk River (Um-sahng´-ten) on the California-Oregon boundary south to Wilson Creek (Tah-geshl -ten) about eight miles north of the mouth of Klamath River. The coast tribe immediately north (on the Oregon side of the line) is called Cheet or Che ´-te. Their language differs materially from that of the Hah´-wun-kwut, though most of the words could be understood. Only a single woman survives. The tribe on the south, from Wilson Creek to Klamath River, is called Tah-che-ten-ne and Tet-le-mus (Polikla). The tribe immediately east of the Cheet on the Oregon side of the California-Oregon boundary is called Ka-Ka-sha. Another name, Choo-ne, also was given but I am in doubt as to whether or not the same tribe was meant. The Ka-ka-sha live near Waldo on the north side of the Siskiyou Mountains and speak a language widely different from that of the Hah´-wun-kwut. They are said to be lighter in color than the coast Indians. Dress and ornament.—The people used deer skin blankets called Nah-hi-ne tanned with the hair on, and also blankets of rabbit skin, called Wa-gah hahs-nis-te. Deer skins tanned with the hair on are called Nah-ki-le. The breech cloth formerly worn by the men was called Rut-soo and tat-es-tat. Moccasins, Kus-ki-a, of elk hide were worn by rich men.
  • 71. The women wore a front apron called Sahng; and on dress occasions an ornamented cloak-like skirt (Chah) that extended all the way around and lapped over in front. They also wore basket hats, called Ki´-e-traht´ and necklaces, the general term for which is Ni-ta-kle-ah. On occasions they wore ear pendants, Bus-shra-mes-lah, of elk or deer bone. Nose bones or shells, Mish-mes-lah, were sometimes worn; those of rich persons consisted of one of the long Dentalium shells. The chin is tattooed with three narrow vertical lines called Tah-ah ruthl -tes. Houses.—The houses (Munt) were square and were built of planks or slabs hewn from redwood trees and stood up vertically, as in the case of those of the Klamath River Indians. The ceremonial houses are called Nā´-stahs-mā´-ne. They are square and have a ridge roof. During important dances the front side is removed. The sweat house is called Shes´-klĕ and is large enough to hold twenty people. It is square or rectangular, and the ground floor is excavated to a depth of about four feet. The roof is of hewn planks covered with earth. Money.—The ordinary medium of exchange or "money" (Trut) consisted of shells of Dentalium, of which the valuable long ones are called Tā´-tos, the commoner short ones Kle´-ah. Clam shell disks or buttons are called Nah´-set. Treatment of dead.—The dead are buried in a grave (Chĕ´-slo). The people assert that they never burned their dead. They say that a spirit or ghost, called Nah-who´-tlan, goes out of the body after death and becomes a ghost. Ceremonial dances.—Dances are called Nā´-stahs or Nesh-stahsh. A puberty dance, Chahs´-stah wā´-nish tahs, was held for the girls. Other important dances are held. Some last 5 days; others last 10 days. The ceremonial drums Hah´-et-sah differ radically from those of any other California Indians known to me. They are large cooking baskets about two feet in diameter. Only new baskets are used in order that they may stand the drumming. Rattles called Chah-pāt´-chah are made of the small hoofs of deer. Cocoon rattles were not used. Whistles, called Tut´-tle-nik are made of large quill feathers of birds, not of bone. The stick game.—The stick game is a feature of the people, as in most California tribes. It consists of a number of slender sticks called Not-trā´-le, of which one, called Chah-when ´, is marked. The counters are called Chun´; the man who keeps count, Chun-ting. A dressed buckskin is stretched tightly on the ground between the players, and when the game is called, the sticks are thrown down upon it. Baskets.—The basketry is of twined weave called Chet-too. The big storehouse baskets, called Hawsh-tan, are closely woven and have a shallow saucer-shape lid. The large open work burden basket is called Tus, the large cooking basket, Met-too´-silch , the small mush bowl Hah´-tsah, the large shallow meal tray Mes-chet´-te-gah´, the large open work shallow bowl Tre-kwahs´-tuk, the small open work plate or platter Kah´-se, the subglobular choke-mouth trinket basket Net´-tah, the milling basket Ki´-e-sut, the baby basket Kah´-yu, its shade Ne´-whats-tah, the women's basket hat Ki´-e-traht´. There is
  • 72. also a subglobular openwork basket called I´-ă-loo´ with an arched handle for carrying on the arm. The cooking bowls, mush baskets, and other small baskets are made of spruce roots, 'Hre´, more or less covered with an overlay of bear grass (Xerophyllum, called Too-tĕchl ) and maiden hair fern (Adiantum) called Ke´-tsi-shah´-te, meaning Blue-jay knees, because of the slender form and black color. The roots used in the carrying baskets, baby baskets, and other coarse baskets are of hazel, called 'Kun. The common black design in ordinary baskets consists of Spruce roots that have been buried in dark mud and are called Tah´-che-gut-kle-ah. They are ordinarily used in connection with the bear grass (Xerophyllum). Fragments of Hahwunkwut myths.—Skum, Coyote man, made the world. When the sun dropped down the Coon caught it up and it was hot, and blackened the insides of his hands. When the world first floated there was just one big white Redwood tree called Kus-choo ´-ke. A big Eagle was sitting on the tree and was king of the world. The Falcon (Tah´-tes) won the battle for the people. Hahwunkwut foods.—A large variety of foods are eaten: meat (Chā´-sun) of elk and deer, both fresh and dried, salmon and other fish, fresh and dried, marrow, tallow, salmon eggs (usually smoke-dried), clams of several kinds, mussels, fish milt both dried and fresh, acorn mush and bread, and a number of roots, berries, and other parts of plants. Among the food berries are strawberries, blackberries, salmon-berries, huckleberries, salal berries, elder berries and manzanita berries. Elder berries are mixed with blackberries and steamed in the ground oven; manzanita berries are mashed and mixed with smoke-dried salmon eggs. Two kinds of kelp are eaten. Root masses of the brake fern (Pteris aquilina, called Tah´-sohn-ki) are cooked in the ground oven. They are said to be like milk and have a fine flavor. Salt is not used. Wild tobacco is called Yahn-sĕch yah-we and Sĕch -yu. The pipe is straight and is called A- chah. Hahwunkwut plant notes.—The Tree Maple (Acer macrophyllum) is called Chā´-she. Its inner bark is used for the ordinary everyday dress for women. The Tanbark Oak is the dominant species in the northwest coast region and its acorns (Sohng´-cheng) are largely eaten by the people. Acorn meal before leaching is called Rut-ta-gaht. If it is allowed to become mouldy, the bitter taste disappears so that it does not have to be leached. Acorn bread cooked on hot ashes is called Seshl -te. The ordinary mush is called Ma-guts-kush. Hahwunkwut animal notes.—The Bobcat (Lynx rufus) is called Ne´-ti-us ah´-nā. Its name is never mentioned in the presence of a baby. If the mother sees one before the baby is born, the baby will have fits and die.
  • 73. The falcon or Duck Hawk (Tah´-tes) was a high personage among the First People. He won the first battle for the Indians, standing on the first Redwood Tree. The California Condor (Tā-long-yi´-chah) is so big and powerful that he can lift a whale. His name shows this as it is from the name of the whale (Tā´-lah) and means "whale lifter." The Dove (Sroo´-e-gun´-sah) cries for his grandmother, especially in the spring of the year. The Purple Finch is called Klah´-nis-me´-tit-le, meaning "many brothers," because the birds go together in small flocks. The Night Heron (Nah-gah´ che yahs´-se) is known as the "sickness bird." Hahwunkwut pits for catching elk and deer.—The Smith River Hah-wun-kwut used to catch elk and deer in pits, called Song´-kit, dug in the ground along the runways. These pits differ materially from those of the Pit River Indians, being much shallower. No effort was made to make them deep enough to prevent the captured animals from jumping out, but an ingenious device was used to prevent them from jumping. The pits were only a little deeper than the length of the legs of the elk, but poles were placed across the top so that when the animal fell through, the body would rest on the poles so his feet could not touch the ground. This of course prevented him from jumping out. When "set," the pits were lightly covered with slender sticks and branches and leaves, to resemble the surrounding ground, but the cover was so frail that an animal the size of a deer would at once break through. Smelt fishery.—At Ocean Shore, Smith River, Calif., July 21, 1934. Vast numbers of smelt, a small surf fish, are caught in nets by the Hawungkwut Indians. During a "run" at high tide flocks of sea gulls hover over the incoming fish, thus making their approach known. The Indians catch them with nets. After a preliminary drying on a circular mat of brush called the nest, the smelt are transferred to the fish bed, a long flat rectangular and slightly elevated area built up of sand and capped with a layer of small smooth stones. On this they are left till thoroughly dry. Massacres of Huss Indians by the whites.—There were three notable killings by the whites. The first killing took place at Burnt Ranch, three miles south of the mouth of Smith River, at the rancheria called Yahnk-tah´-kut, a name perpetuated by the district school house name. Here a large number of Indians were caught during a ceremonial dance and ruthlessly slaughtered. The Indians say this was the first killing. The second killing was at the rancheria of Ā´-choo-lik on the big lagoon known as Lake Earl about three miles north of Crescent City [cf. Drucker's etculet in Drucker, 1937, map 3]. The Indians were engaged in gambling at the time. The third killing was at the large village of Hah-wun-kwut [Xawun hwut, Drucker, 1937, map 3] at the mouth of Smith River. At the time of the Indian troubles in northwestern California Chief Ki´-lis (named for Ki-o- lus the Willow tree) was chief of the Hah´-wun-kwut tribe.
  • 74. Three young men of the tribe were active in resenting the aggressions of the whites and were said to have killed several of the early settlers. They were very clever and neither the settlers nor the soldiers were able to capture them. Finally the officer in charge of the troops at Fort Dick (a log fort on Smith River, about three miles from the present settlement called Smith River Corners) told Chief Ki´-lis that he would be hung by the soldiers unless he captured the three young men in question. It happened that the chief had two wives, who were sisters of the three young men. The chief was in great trouble and called a meeting of his head men. They said that if the people would contribute enough blood money (which consists of the long Dentalium shells) they could pay the two sisters the price necessary to atone for the killing in accordance with the law of the tribe. The people agreed to this and raised the necessary money. The nearest male relatives of the young men were chosen to do the killing, but the young men could not be found. One day when one of the chief's wives was getting mussels near the mouth of Smith River one of the young men appeared and told her that he and his brothers were hungry and wanted food. She designated a place on the point of a nearby ridge where she said she would take food, and it was agreed that the three brothers would come to get it in the late afternoon or early evening. She then went home and told her husband, Chief Ki- lis, who in turn notified the nearest relatives of the young men; they went and concealed themselves near the spot. When the young men came and were looking for the food their relatives fell upon them and killed them. They were buried in the same place and the graves may be seen there to this day. The officer in charge of the troops was greatly pleased. He and his soldiers arranged "a big time," giving the Indians plenty to eat and also some blankets. This ended the "Indian war" in that region. There is a small island called Stun-tahs ahn-kot (50 acres or more in extent) in the lower part of Smith River, half or three-quarters of a mile from its mouth. On some of the early maps it bears the name Ta´-les after the chief. This island the officer gave to the Indians in the name of the Government, telling them it would always be theirs, and gave the chief a paper stating that it was given in return for killing the three outlaw boys. Sometime afterward this paper was burned. After the Indians had been driven to the Hoopa Reservation and had come back, they were not allowed to go to their former rancheria Hah´-wun-kwut, but were told to go to this island. Later the whites claimed the island and did not let the Indians have it. The present Indian settlement, a mile or two north of the mouth of Smith River, was purchased for the Indians in or about 1908 by Agent Kelsey of San Jose, and paid for by the Indian Office from a part of an appropriation made by Congress for homeless California Indians. It is occupied at present (1923) by ten or a dozen families. APPENDIX II: NOTES ON UPPER EEL RIVER INDIANS By A. L. Kroeber
  • 75. YUKI "TRIBES" The following data were got from Eben Tillotson at Hulls Valley, north of Round Valley, on July 12, 1938. A. Eben said he was a Wi·t'u·knó'm Yuki. This was a "tribe" speaking a uniform dialect, having uniform customs, but embracing several "tribelets." Their general territory was along main (or middle) Eel R. where this runs from E to W, on both sides of it, and S of Round V. They also owned Oklá·c̆ and Púnki·nipi·ṭ ("wormwood hole"), Poonkiny. The subdivisions or tribelets were: [10.6] 1. Us̆ i·c̆ lAlhótno'm ("crayfish-creek-large-people") on Salt Cr., S of Middle Eel. 2. Olkátno'm, at Henley or Hop ranch in S part of Round V., where the road enters the flat of the valley. They owned S to the Middle Eel and down it to Dos Rios confluence. 3. Alniuk'í·no'm, at W edge of Round V. 4. Ontítno'm, E of Henley ranch in Round V.; also Eden V. to S. B. The following were not grouped together by the informant, but agree in having a southerly range: [10.6] 5. LAlkú·tno'm, around Outlet Cr. 6. Tí·tAmno'm, eastward, across (S of Middle) Eel R., toward Sanhedrin Mt., W of the ridge which runs W of Gravelly V. Mountain people, without villages of size. Dixie Duncan was half of this group. 7. Ki·c̆ ilú·kam is Gravelly V. The Huchnom roamed in that. C. East of Hull's V., extending nearly to Hammerhorn Mt., but this was Nomlaki. [10.6] 8. ŠipimA´lno'm, on a creek running from W into (S-flowing) Eel R. 9. I·'mptí·tAmno'm, at an opening in the range—i·'mp is a gap. They were across the Eel, on its E side. 10. Pi·lílno'm, beyond (farther E or SE?), at Kumpí·t, "salt hole," where salt was got, also at Snow Mt. These were Yuki, but "talked something like" Nomlaki Wintun (who adjoined them, across the main Coast Range watershed). Their language was about as different from Yuki as was Huchnom. They were "half Stony Creek" (along which lived Salt Pomo, then Hill Patwin, then Nomlaki). 11. U·k'í·c̆ no'm (added later by informant), in Williams V., "E" of Hull's V. 12. A Yuki group at Twin Rock Cr.—Eben had forgotten their name. D. The real Yuki, centering in Round V., and coming N into the foothills only about as far as Ebley's Flat. To the N were the Onainó'm, Pitch Indians, Athabascans, who owned Hull V. ("here") and adjoined the ŠipimAlno'm (no. 8).
  • 76. [10.6] 13. Hákno'm, in Round V., around Agency, in the N side of the valley. 14. Ukomnó'm, in middle of the valley. They did not own up into the mountains. 15. At TotimAl, W of Covelo, were a people whose name Eben had forgotten. 16. At NW end of Round V., another group whose name he could not recall. It will be seen that the informant's knowledge was fullest for the part of Yuki territory S of Round V. He thought that all the groups mentioned made the Taikomol and Hulk'ilAl initiations and performances. Orthography Used A a mid-raised a, nasalized ṭ retroflex or palatal t Š sh c̆ ch k' etc. glottalized · long ƚ surd l, Athabascan only η ng Athabascan
  • 77. Map 18. Yuki "Tribes" according to Eben Tillotson. ATHABASCAN DATA DATA FROM EBEN TILLOTSON Onainó'm were the Pitch Indians, a people of the rugged mountains, adjoining the ŠipimA ´lno'm Yuki, and with Hull's Valley in their range. They were "half Yuki and half Wailaki," and spoke both languages. The TA´no'm were at Spy Rock on main Eel R. They were also half Yuki and half Wailaki and bilingual. [But other Yuki cite them as Yuki who also knew Wailaki.] TAno'm were: Nancy Dobie, Sally Duncan, and Tip. These two groups did not make Taikomol or Hulk'ilAl rites [this agrees with Handbook] but, probably knew about them from having seen them performed. Between the Pitch people and the TAno'm, in the Horse Ranch country, lived the Ko'il, the Wailaki (proper). Most of the survivors of these spoke Yuki also.
  • 78. DATA FROM LUCY YOUNG The following notes, mainly on Athabascans, were obtained at Round Valley on July 13, 1938. Lucy Young, the informant, was born on Eel River at Tseyes̆ enteƚ, opposite Alder Point. Though listed by the Government as a Wailaki, she is actually what ethnologists call Lassik. Her father was born 3 mi. from Alder Pt.; her mother, at Soldier Basin, 22 mi. NE. Her mother's first cousin was T'a·su's, known to the whites as Lassik, from his Wintun name Lasek. He was chief for Alder Pt., Soldier Basin, (upper) Mad River. Mary Major, informant's contemporary, is from Soldier Basin and of the same tribe. The following were obtained as names of groups of people, though some of them may be place names. Setelbai, "yellow rock," Alder Pt., etc. Nals̆ a, "eat each other," downstream, around Fort Seward. Kos̆ o-yaη, "soaproot eaters," farther downstream and on Van Duzen R. Tenaη-keya, Mad R. Indians. Kentetƚa(η), Kettenchow V., a flat with roots. Sec̆ (ƚ)enden-keya, at Zenia. Ka·snol-keya, S of Zenia, called Kikawake in Hayfork [Wintun]. Tok'(a)-keya, South Fork of Eel Indians [Sinkyone]. Sayaη, "lamprey eel eaters," the Spy Rock Wailaki [the Ko'il of Tillotson]. Djeh-yaη, "pinenut eaters," the Pitch Wailaki, on North Fork Eel R. [The outlook seems to have been chiefly downstream and inland.] Non-Athabascans C̆ iyinc̆ e, Yuki. Baikihaη, Hayfork Wintu. Yaη-keya, the Wintu from Weaverville to Redding; their own name was Poibos. The same name Yaη-keya was applied also to the Cottonwood Creek Wintun, whom the Lassik met at Yolla Bolly Mt. to trade salt. [Wintu and Wintun were treated as one language.] Yitá·kena, people of lowest Eel R., the Wiyot.
  • 79. BIBLIOGRAPHY Abbreviations AA American Anthropologist BAE-B Bureau of American Ethnology, Bulletin SI-MC Smithsonian Institution, Miscellaneous Collections UC University of California Publications -AR Anthropological Records -IA Ibero-Americana -PAAE American Archaeology and Ethnology American Anthropological Association 1916. Phonetic Transcription of Indian Languages, Report of Committee of American Anthropological Association, SI-MC, Vol. 66, No. 6. Barrett, S. A. 1908. The Ethno-Geography of the Pomo and Neighboring Indians. UC-PAAE 6:1- 332. Bennett, C. A., and N. L. Franklin 1954. Statistical Analysis in Chemistry and the Chemical Industry. John Wiley and Sons, New York. Cook, S. F. 1943. The Conflict between the California Indian and White Civilization: I. UC-IA 21, pp. 161-194. 1955. The Aboriginal Population of the San Joaquin Valley, California. UC-AR 16:31- 80. 1956. The Aboriginal Population of the North Coast of California. UC-AR 16:81-130. Cook, S. F., and A. E. Treganza 1950. The Quantitative Investigation of Indian Mounds. UC-PAAE 40:223-262. Curtis, E. S. 1924. The North American Indian. Vols. 13, 14. Dixon, Roland B.
  • 80. 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! ebookbell.com