0% found this document useful (0 votes)
138 views

Full Download Starting Out with Java From control structures through Objects 7th Edition Tony Gaddis PDF DOCX

The document promotes the ebook 'Starting Out with Java From Control Structures through Objects 7th Edition' by Tony Gaddis, available for download on ebookmeta.com. It also lists other recommended digital products by the same author and provides links to various related ebooks. Additionally, it includes copyright information and a brief overview of the book's contents.

Uploaded by

kritzmcley7n
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views

Full Download Starting Out with Java From control structures through Objects 7th Edition Tony Gaddis PDF DOCX

The document promotes the ebook 'Starting Out with Java From Control Structures through Objects 7th Edition' by Tony Gaddis, available for download on ebookmeta.com. It also lists other recommended digital products by the same author and provides links to various related ebooks. Additionally, it includes copyright information and a brief overview of the book's contents.

Uploaded by

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

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Starting Out with Java From control structures


through Objects 7th Edition Tony Gaddis

https://ebookmeta.com/product/starting-out-with-java-from-
control-structures-through-objects-7th-edition-tony-gaddis/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Starting Out with C++ - From Control Structures through


Objects 9th Edition Tony Gaddis

https://ebookmeta.com/product/starting-out-with-c-from-control-
structures-through-objects-9th-edition-tony-gaddis/

ebookmeta.com

Starting Out with Visual Basic - 8th Edition Tony Gaddis

https://ebookmeta.com/product/starting-out-with-visual-basic-8th-
edition-tony-gaddis/

ebookmeta.com

Starting out with Visual C# 5th Edition Tony Gaddis

https://ebookmeta.com/product/starting-out-with-visual-c-5th-edition-
tony-gaddis/

ebookmeta.com

Print Culture and the Formation of the Anarchist Movement


in Spain 1890 1915 1st Edition James Michael Yeoman

https://ebookmeta.com/product/print-culture-and-the-formation-of-the-
anarchist-movement-in-spain-1890-1915-1st-edition-james-michael-
yeoman/
ebookmeta.com
Identity Configuration of the Russian Youth monograph 1st
Edition Zinurova

https://ebookmeta.com/product/identity-configuration-of-the-russian-
youth-monograph-1st-edition-zinurova/

ebookmeta.com

Best Hikes Los Angeles The Greatest Trails in the La


Mountains Beaches and Canyons 2nd Edition Allen Riedel
Monique Riedel
https://ebookmeta.com/product/best-hikes-los-angeles-the-greatest-
trails-in-the-la-mountains-beaches-and-canyons-2nd-edition-allen-
riedel-monique-riedel/
ebookmeta.com

Encounters with the Real in Contemporary Italian


Literature and Cinema 1st Edition Loredana Di Martino

https://ebookmeta.com/product/encounters-with-the-real-in-
contemporary-italian-literature-and-cinema-1st-edition-loredana-di-
martino/
ebookmeta.com

Next Door Blake Pierce

https://ebookmeta.com/product/next-door-blake-pierce/

ebookmeta.com

A Best Practice Guide to Sex and Storytelling Filming


Scenes with Sex and Nudity 1st Edition John Bucher

https://ebookmeta.com/product/a-best-practice-guide-to-sex-and-
storytelling-filming-scenes-with-sex-and-nudity-1st-edition-john-
bucher/
ebookmeta.com
An Artist s Guide to Programming Jim Parker

https://ebookmeta.com/product/an-artist-s-guide-to-programming-jim-
parker/

ebookmeta.com
Starting Out With Java ™
From Control Structures through Objects
Starting Out With Java ™
From Control Structures through Objects

SEVENTH EDITION

Tony Gaddis

Haywood Community College

330 Hudson Street, NY NY 10013


Senior Vice President Courseware Portfolio Management: Marcia J.
Horton
Director, Portfolio Management: Engineering, Computer Science &

Global Editions: Julian Partridge

Portfolio Manager: Matt Goldstein

Portfolio Management Assistant: Meghan Jacoby

Managing Content Producer: Scott Disanno


Content Producer: Amanda Brands

Rights and Permissions Manager: Ben Ferrini

Manufacturing Buyer, Higher Ed, Lake Side Communications, Inc.

(LSC): Maura Zaldivar-Garcia


Inventory Manager: Ann Lam

Product Marketing Manager: Yvonne Vannatta

Field Marketing Manager: Demetrius Hall

Marketing Assistant: Jon Bryant

Cover Designer: Joyce Wells

Cover Photo: Shutterstock/Tim UR


Printer/Binder: LSC Communications, Inc.

Full-Service Project Management: Sasibalan Chidambaram, SPi Global

Credits and acknowledgments borrowed from other sources and

reproduced, with permission, in this textbook appear on appropriate page

within text.

Copyright © 2019, 2016, 2013 by Pearson Education, Inc., Hoboken, New


Jersey 07030. All rights reserved. Manufactured in the United States of

America. This publication is protected by copyright and permissions

should be obtained from the publisher prior to any prohibited

reproduction, storage in a retrieval system, or transmission in any form or

by any means, electronic, mechanical, photocopying, recording, or


likewise. For information regarding permissions, request forms and the

appropriate contacts within the Pearson Education Global Rights &

Permissions department, please visit http://www.pearsoned.com/

permissions/.

Many of the designations by manufacturers and seller to distinguish their

products are claimed as trademarks. Where those designations appear in

this book, and the publisher was aware of a trademark claim, the

designations have been printed in initial caps or all caps.

Unless otherwise indicated herein, any third-party trademarks that may

appear in this work are the property of their respective owners and any

references to third-party trademarks, logos or other trade dress are for

demonstrative or descriptive purposes only. Such references are not

intended to imply any sponsorship, endorsement, authorization, or

promotion of Pearson’s products by the owners of such marks, or any

relationship between the owner and Pearson Education, Inc. or its

affiliates, authors, licensees or distributors.

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® Windows®, and Microsoft Office® are registered trademarks of

the Microsoft Corporation in the U.S.A. and other countries. This book is

not sponsored or endorsed by or affiliated with the Microsoft


Corporation.

Oracle and Java are registered trademarks of Oracle and/or its affiliates.
Other names may be trademarks of their respective owners.

Library of Congress Cataloging-in-Publication Data

Names: Gaddis, Tony, author.

Title: Starting out with Java. From control structures through objects /

Tony Gaddis, Haywood Community College.

Description: Seventh edition. | NY, NY : Pearson Education, Inc., [2019] |


Includes index.

Identifiers: LCCN 2017060354| ISBN 9780134802213 | ISBN 0134802217

Subjects: LCSH: Java (Computer program language) | Data structures


(Computer science) | Object-oriented programming (Computer science)
Classification: LCC QA76.73.J38 G333 2019 | DDC 005.13/3--dc23 LC
record

available at https://lccn.loc.gov/2017060354

1 18

ISBN 10: 0-13-480221-7

ISBN 13: 978-0-13-480221-3


Contents in Brief
Chapter 1 Introduction to Computers and Java 1 

Chapter 2 Java Fundamentals 27 

Chapter 3 Decision Structures 111 

Chapter 4 Loops and Files 189 

Chapter 5 Methods 269 

Chapter 6 A First Look at Classes 317 

Chapter 7 Arrays and the ArrayList Class 403 

Chapter 8 A Second Look at Classes and Objects 493 

Chapter 9 Text Processing and More about Wrapper Classes 557 

Chapter 10 Inheritance 611 

Chapter 11 Exceptions and Advanced File I/O 701 

Chapter 12 JavaFX: GUI Programming and Basic Controls 759 

Chapter 13 JavaFX: Advanced Controls 823 

Chapter 14 JavaFX: Graphics, Effects, and Media 909 

Chapter 15 Recursion 999 

Chapter 16 Databases 1027 

Index 1109 

Appendices A–M Companion Website

Case Studies 1–7 Companion Website


Chapters 17–20 Companion Website
Contents
Preface xxiii 

Chapter 1 Introduction to Computers and Java 1

1.1 Introduction 1 

1.2 Why Program? 1 

1.3 Computer Systems: Hardware and Software 2 

Hardware 2 

Software 5 

1.4 Programming Languages 6 

What Is a Program? 6 

A History of Java 8 

1.5 What Is a Program Made Of? 8 

Language Elements 8 

Lines and Statements 11 

Variables 11 

The Compiler and the Java Virtual Machine 12 

Java Software Editions 13 

Compiling and Running a Java Program 14 

1.6 The Programming Process 16 

Software Engineering 18 

1.7 Object-Oriented Programming 19 

Review Questions and Exercises 21 


Programming Challenge 25 

Chapter 2 Java Fundamentals 27 

2.1 The Parts of a Java Program 27 

2.2 The print and println Methods, and the Java API 33 

2.3 Variables and Literals 39 

Displaying Multiple Items with the + Operator 40 

Be Careful with Quotation Marks 41 

More about Literals 42 

Identifiers 42 

Class Names 44 

2.4 Primitive Data Types 44 

The Integer Data Types 46 

Floating-Point Data Types 47 

The boolean Data Type 50 

The char Data Type 50 

Variable Assignment and Initialization 52 

Variables Hold Only One Value at a Time 53 

2.5 Arithmetic Operators 54 


Integer Division 57 

Operator Precedence 57 

Grouping with Parentheses 59 

The Math Class 62 

2.6 Combined Assignment Operators 63 


2.7 Conversion between Primitive Data Types 65 
Mixed Integer Operations 67 

Other Mixed Mathematical Expressions 68 

2.8 Creating Named Constants with final 69 

2.9 The String Class 70 


Objects Are Created from Classes 71 

The String Class 71 

Primitive Type Variables and Class Type Variables 71 

Creating a String Object 72 

2.10 Scope 76 

2.11 Comments 78 

2.12 Programming Style 83 

2.13 Reading Keyboard Input 85 

Reading a Character 89 

Mixing Calls to nextLine with Calls to Other Scanner Methods 89 

2.14 Dialog Boxes 93 


Displaying Message Dialogs 93 

Displaying Input Dialogs 94 

An Example Program 94 

Converting String Input to Numbers 96 

2.15 Common Errors to Avoid 99 

Review Questions and Exercises 100 

Programming Challenges 106 


Chapter 3 Decision Structures 111 

3.1 The if Statement 111 

Using Relational Operators to Form Conditions 113 

Putting It All Together 114 

Programming Style and the if Statement 117 

Be Careful with Semicolons 117 

Having Multiple Conditionally Executed Statements 118 

Flags 118 

Comparing Characters 119 

3.2 The if-else Statement 120 

3.3 Nested if Statements 122 

3.4 The if-else-if Statement 128 

3.5 Logical Operators 134 


The Precedence of Logical Operators 139 

Checking Numeric Ranges with Logical Operators 140 

3.6 Comparing String Objects 142 

Ignoring Case in String Comparisons 146 

3.7 More about Variable Declaration and Scope 147 

3.8 The Conditional Operator (Optional) 149 

3.9 The switch Statement 150 

3.10 Displaying Formatted Output with System.out.printf and

String.format 160 
Format Specifier Syntax 163 
Precision 164 

Specifying a Minimum Field Width 164 

Flags 167 

Formatting String Arguments 170 

The String.format Method 172 

3.11 Common Errors to Avoid 174 

Review Questions and Exercises 175 

Programming Challenges 181 

Chapter 4 Loops and Files 189 


4.1 The Increment and Decrement Operators 189 
The Difference between Postfix and Prefix Modes 192 

4.2 The while Loop 193 

The while Loop Is a Pretest Loop 196 

Infinite Loops 196 

Don’t Forget the Braces with a Block of Statements 197 

Programming Style and the while Loop 198 

4.3 Using the while Loop for Input Validation 200 

4.4 The do-while Loop 204 

4.5 The for Loop 207 

The for Loop Is a Pretest Loop 210 

Avoid Modifying the Control Variable in the Body of the for Loop 211 

Other Forms of the Update Expression 211 

Declaring a Variable in the for Loop’s Initialization Expression 211 


Other documents randomly have
different content
Kawelo then looked towards
Wailua and saw that the sands
were in disorder and were
hollowed out in places, leaving
little gulches here and there, with
the rocks exposed. And when he
saw the people like the bending
of the surf, he chanted:

How numerous are the high He mea e nei la kaikoo nui o kai,
surfs today below! Ke auau nei ka moana,
The ocean is bathing in foam. He kai paha no Kahinalii,
Is it the sea of Kahinalii? 37 Ua ku ke a, ka halelo,
For the rocks are exposed and Ke ahua pohaku i Wailua nei la,
the sand is in hollows, O ua one maikai nei,
And the rocks are in heaps in Ua malualua, ua kahawai,
Wailua. I ka pohaku o Kauai,
The sands that once were level O Kauai nui moku lehua,
Are cut up and are in gulches; Aina make kau aloha ole,
Cut up by the rocks of Kauai, Pili makamaka ole ia Kawelo nei
Great Kauai, isle of lehua; 38 la.
Land of death and lacking in
love,
Whose people are not the
friends of Kawelo.

At the close of this chant, A pau keia paha ana, paha hou
Kawelo paused awhile and then aku la no o Kawelo:
continued:

O thou owl, O thou owl! Pueo—e, Pueo—e,


The owl that is wet by the rain, Pueo opili i ka ua,
Pueo kanikani i ka ua,
The owl that is hooting in the Pa na’u na Kawelo,
rain, Na ke koa i ke awakea,
You are hit by Kawelo, He kaha pue wai no Wailua,
By the soldier of the noonday, Ke alo hiki i Kaupea,
The soldiers of the waters of Kuhi au ka luhi kaua,
Wailua, O Onionikaua.
Of the path that leads to Kaupea Pau na kanaka i ka lae one,
Where you and I are made He loaa i loko o Kuikaa,
weary, Ke poo kapu o Hihimanu,
Onionikaua. 39 Nau na kui—e;
The men are all at the sand Nau na kui—e.
point,
They are found within Kuikaa,
The kapued head of Kuikaa.
Grind your teeth in rage,
Grind your teeth in rage.
[38]

All the people who were not O ka poe a pau i makau ole ia
afraid of Kawelo that held their Kawelo, pau loa lakou i ka make
ground were killed by the use of i ka laau palau a Kawelo, ia
his war club Kuikaa. As one side Kuikaa. A make kekahi aoao ia
was killed by Kawelo, the canoe Kawelo, hio ae la na waa, ia hio
leaned over on that side; Kawelo ana, e hahau hou iho ana o
then swung his club along the Kawelo i kana laau palau i
other side killing all the men kekahi aoao, pau loa i ka make.
there. In this slaughter, the two Ma keia make ana, ua make na
officers who were stationed at pukaua elua e noho ana i
Wailua were also slain. Kawelo Wailua. Ia wa, hoouna o Kawelo
then sent Kamalama and his ia Kamalama, ke kaikaina, na
adopted sons, Kaeleha, keiki, o Kaeleha, Kalaumeki, o
Kalaumeki and Kauluiki and his Kauluiki ma.
companions, after the fleeing
enemy.

CHAPTER III. MOKUNA III.

Commencement of the Hoomaka ke Kaua a


Battle Between Kawelo me ko Kauai
Kawelo and the Poe.
People of Kauai.

As soon as Kamalama heard the A lohe o Kamalama i keia olelo a


orders of Kawelo, he Kawelo, hoonoho iho ia ekolu
immediately set his forces in mahele kaua. O Kaeleha, a me
order of battle in three divisions. kekahi mau koa Ulu ma kekahi
Kaeleha and some of Kauluiki’s aoao o ka waa kaua; o
companions were placed on one Kalaumeki a me kekahi mau koa
side of the war canoe, Ulu ma kekahi aoao; o
Kalaumeki with the remainder of Kamalama i waena o ke kuamoo
Kauluiki’s companions were kaua. I ko lakou kaua ana, aole
placed on the other side while o lakou mea i make, eia nae, ua
Kamalama himself took up the komo ka makau i loko o Kauluiki
central position. In the battle that ma, i na koa o Kauai. Nolaila,
followed these preparations, haalele iho la lakou i ke kaua
none of Kawelo’s men were ana, hoi aku la a na waa o lakou.
killed; but Kauluiki and his
companions were so afraid of Ninau mai o Kawelo: “Pehea ke
the warriors of Kauai that they kaua?” Olelo aku ua poe Ulu nei:
gave up fighting and returned to “Aohe pono i koe, haalele aku
their canoe. When Kawelo saw nei makou, aneane e hee mai ko
them coming, he asked them: kaikaina a me au keiki i kela
“How is the battle?” Kauluiki and aoao. Nolaila, hoi mai nei makou
his companions answered: “We e hai aku ia oe, o na waa no o
are beaten. When we left, your kakou a lana aku i kai, alaila,
younger brother and adopted nana aku o ka hoi mai o ko
sons were on the point of being kaikaina, me au keiki, aka, i
routed by the opposing forces. make mai, hoi no kakou i Oahu.”
We have therefore returned to
inform you of this and to get our A lohe o Kawelo i keia mau olelo
canoe out to sea where we can a ka poe Ulu, koo aku la kona
wait for their return; but if they mau wawae i ka moena a paa,
get killed, we will be ready to paa ae la hoi na lima, hakahaka
return to Oahu.” When Kawelo o loko o ka maka moena, nana
heard this from Kauluiki and his mai la o Kawelo ma laila. Ike aku
companions, he stretched out his la ia i ke koa o kona kaikaina, o
feet against the mat and pulled Kamalama, a me na keiki,
the plaiting of the mat down, thus aneane e auhee kela aoao,
making a slit in the mat and mahalo aku la ia i ke koa o
looked through it. When he lakou. A mahope, ike aku la ia e
looked through, he saw the luku ana o Kamalama ma i kela
bravery of his brother Kamalama aoao, a o ke koena i koe, e holo
and adopted sons; they were on aku ana i luna o ka puu o
the point of routing the Kauai Nounou.
forces, and he admired the
Aia hoi i luna o ka puu o
courage of his [handful of] men.
Nounou, o Aikanaka ke ’lii, a me
After this he saw Kamalama and
Kauahoa, ke koa ikaika o Kauai.
his men killing the men on the
Nolaila, manao iho la o Kawelo,
other side, while the few of the
o make o Kamalama ia
enemy left were running up
Kauahoa, nolaila, paha aku la ia,
Nounou hill. On the top of this
penei:
hill, Aikanaka the king and
Kauahoa the great warrior of
Kauai had their camp. Kawelo
was therefore very anxious lest
Kamalama’s forces suffer at the
hand of Kauahoa; so he called to
him in a chant as follows:

A few are consumed, many are Pau iki, pau nui,


consumed, Pau loa, pau poko,
All are consumed in a short Pau a’u lehua i ka manu,
space of time. Ke aina mai la e ka manu.
Your lehua blossoms are Na pua lehua i aina e ka manu a
consumed by the birds, koe koena,
They are being eaten by the Kalohe ua kamalii la, ko lelehu,
birds, Lehulehu mai la ke one,
The lehua blossoms that are Hopu i ka papa hee i ka nalu, [41]
partly eaten by the birds, 40 Kakala e Kamalama,
The children are sporting with O oe la ke koi, owau ka helu ai,
your men. Pau ka pili, ele ka ai i ka maha,
The people are gathering on the O—e ohi ka pili,
sand, I lalo kuli o Kamalama,
They take up their boards to ride Pau ana ka ai i ke poho,
the surf. [40] Mo ka ihu i ka iliohae,
Kamalama is like a full-grown Hae ka puaa i kona kahu,
cock. Hae ka mano i ke kala,
Thou art the piercing rod; I will Hae ka puhi i ka maunu,
keep the record. Eueu kolea i ka pupua,
After they are slain, the record Pelua kuli, hana a noho,
will surely be great. Ia Kuahilau ka luahi a kaua,
Yes, gather up the spoils. Kaa i ke oho, helu papalua,
Kamalama’s knees are bent He la koa, he la hee,
down, He la malu nei e Kamalama,
The food will soon be prepared, Ke lolelua nei ka ihe i ka lima,
The nose is bitten by the barking Ke kui nei ka ihe i ka pali lehua,
dog, Moa keiki, kuku ka heuheu
The pig will attack its master. Okala ka hulu o ke kea i halala,
The shark will attack the kala He pukoa wawahi waa o
fish, Kamalama no Wailua nei,
The eel will attack the bait, Hoouka ia i na koa,
The plover will shake its tail, Hee kuamoo me ka huna lewa,
Bend the knees, make him sit, Auhee liilii, ioio moa i ka nahele
Kuahilau our opponent. I ka li a ke auhee nui,
Straighten out the hair, and thus E ao ka loko e Kamalama,
double your points. Aia mai ka maha laau
There is a day when one is O ka oa o Mamalahoa.
brave and a day when one is O kauwila o Puukapele,
routed. O ka hapupue o Haalelea,
This is a cool day, Kamalama, O kee la o Kalalau,
For the spear is darting I wai auau no Kamalama,
backwards and forwards from E Kamalama e kuu pokii, e hoi.
the hand.
The spear is stringing the cliffs of
lehua.
The down of a young chicken
stands up,
The feathers of the cock are
ruffled.
Kamalama is like a hidden reef
which breaks the canoes of
Wailua
Loaded down with warriors.
The highways are filled with the
fleeing soldiers
Scattered and peeping like
young chicks in the brush.
Forbear of the great slaughter,
Beware of thine inwards, 41
Kamalama.
Eat up the points of the spears
Made from the rafters of
Mamalahoa,
The kauwila wood of Puukapele,
The hapupue of Haalelea,
The kee of Kalalau.
They are as playthings for
Kamalama.
Kamalama, my younger brother,
come back.

In this chant of Kawelo’s, his Ma keia paha a Kawelo, hoi mai


three soldiers, Kamalama, la o Kamalama a me Kaeleha
Kaeleha and Kalaumeki, heard ma laua o Kalaumeki, a hiki
it, and they returned. Upon their lakou i kahi o Kawelo ma, ninau
arrival at the place where mai la o Kawelo: “Pehea ke
Kawelo and the others were kaua?” I aku o Kamalama: “Ua
standing, Kawelo asked them: pau o Kuahulu ma i ka make, a o
“How fares the war?” Kamalama na kanaka i koe, oia no kela e pii
replied: “Kuahulu 42 and his la i ka puu o Nounou, a o ka
companion and a good many of hoahanau no o kaua ke koa nui
their men are dead; what few are o luna i koe, o Kauahoa.”
left are those that are climbing
the hill, Nounou; and Kauahoa, A lohe o Kawelo i keia olelo a
our relative, is the greatest kona kaikaina, maopopo iho la ia
warrior that is left on the hill.” ia he hoopunipuni o Kauluiki ma,
When Kawelo heard his manao iho la ia he poe koa hohe
brother’s report, he realized at wale, nolaila, paha aku la o
once that the report given him by Kawelo, penei:
Kauluiki and the others was all a
lie, and he was therefore
satisfied that they were cowards.
Therefore he chanted the
following lines:

You certainly do not deserve Aole hoi no oukou kahi aloha,


even a small portion of pity No ka pohaku i kaa aku nei; [43]
Because of the rock that has just Komo hewa ko’u waa,
rolled. [42] Pau hewa ka’u ia me ka’u ai,
The loading down of my canoe Pau hewa ko’u kapa me ko’u
was a waste, malo.
The consuming of my food and Kai no he koa no ka la nui,
meat were without any benefit. Aole he koa no ka la iki;
My kapas and loin cloths were Wahawaha i ka laau nui,
worn without any returns. He iki hoi ke kihapai,
I had thought that you were O ka noho ana ka ia Kauai,
soldiers worthy of a great day, Noho i kalukalu o Puna,
But I see that you are only Lilo Puna ia Kaeleha,
soldiers for small affairs. Lilo Kona ia Kamalama,
You detested the great stick, Lilo Koolau ia Kalaumeki,
Your cultivated fields will Pau ka aina i na koa,
therefore be small Mihi i ka hune e Kauluiki ma.
In your occupation of Kauai, Aloha i ka hoi wale e na pokii e,
In the kalukalu of Puna. Nele e na pokii i ka aina ole la.
Puna shall be possessed by
Kaeleha,
Kona shall be possessed by
Kamalama,
Koolau shall be possessed by
Kalaumeki; 43
All the lands are possessed by
the brave ones.
Kauluiki and the others shall
repent of their want.
How I pity your return with
nothing, younger brothers,
For my younger brothers are
indeed without possessions.

When Kauluiki and the others A lohe o Kauluiki ma, pane aku
heard this, they said: “How much la lakou: “Ka! E aho no ka hoi ka
better our conditions would have noho ana me Kakuhihewa, he ai
been had we stayed with i kalo moa, he ole loa ka hoi ka
Kakuhihewa; we would surely holo ana mai nei me Kawelo. Ua
have eaten of the cooked taro, pau ka aina i na koa, o ke aha la
while in following Kawelo we get ka kakou?” Nolaila, manao iho la
nothing, for the lands will be lakou e hoi i Oahu nei.
given to the brave soldiers only,
and what will we get?” They then
thought of returning to Oahu.

CHAPTER IV. MOKUNA IV.

Relating to E Pili ana no


Kaehuikiawakea.— Kaehuikiawakea.—No
Kaihupepenuiamouo Kaihupepenuiamouo a
and Muno.— me Muno.—No
Walaheeikio and Walaheeikio a me
Moomooikio. Moomooikio.

When Kaehuikiawakea saw that Ike iho la o Kaehuikiawakea, ua


their chief warriors in Wailua make na pukaua o lalo o Wailua,
were slain, he climbed up the pii aku la ia i luna o ka puu o
Nounou hill and informed Nounou, e hai aku ia Aikanaka i
Aikanaka of the facts and how ka make o na pukaua a me na
most of their men and the two kanaka o lalo. Ma keia pii ana o
captains were slain. As Kaehuikiawakea i luna o ka puu
Kaehuikiawakea was climbing o Nounou, ike aku la o Kawelo, a
the hill, Kawelo saw him and so paha aku la ia ia Kamalama:
called out to Kamalama in a
chant as follows:

O little Kamalama, my younger E Kamalama iki kuu pokii,


brother, Kuu pokii e, kuu pokii.
My younger brother, my younger
brother!

Kamalama replied: “Yes.” O mai la o Kamalama: “O.” I aku


Kawelo then said to him: “Chase o Kawelo: “E alualu aku oe i kahi
after our relative, unloose his loin pokii o kaua, a wehe mai oe i
cloth, scratch his side and let kahi malo, a wawau aku oe ma
him go.” ka aoao, a hookuu aku.” A lohe
o Kamalama, alualu aku la ia, a
When Kamalama heard this, he loaa o Kaehuikiawakea, alaila,
chased and caught up with kahea aku la: “A make! A make!!
Kaehuikiawakea, and then called A make oe e Kaehuikiawakea!!!”
out: “You are dead! You are Ma keia mau leo puiwa a
dead!! I am going to kill you, Kamalama, ua makau loa o
Kaehuikiawakea!!!” When Kaehuikiawakea, a kokoke loa e
Kaehuikiawakea heard this, he pau kona mama. A hiki o
was so afraid that he was almost Kaehuikiawakea i luna o ka puu
unable to run any more. On his o Nounou, lalau aku la o
reaching the top of the hill, Kamalama, kaili ae la i ka malo,
Kamalama reached out and took a wawau mai la i ka aoao, a
his loin cloth, scratched his side hookuu aku la. A hiki o
and allowed him to go. Kaehuikiawakea i mua o
Aikanaka, huli iho la i lalo kona
alo. Ninau mai la o Aikanaka,
penei: “A hua a pane! A pane ka
waha, he hoolono ko onei.” [45]

When Kaehuikiawakea arrived in I mai o Kaehuikiawakea: “Ua


the presence of Aikanaka, he fell pau loa kakou, aohe kanaka i
face down. [44]Aikanaka then koe, ua pau loa i ka make.”
asked him: “Speak the word. Ninau aku o Aikanaka: “Owai na
Open your mouth and speak the waa?” “O Kamalama ka hai mua
word, I am listening.” ana mai i kai, i ka pae ana mai i
Kaehuikiawakea then said: “We uka, o Kawelo ka keia ope nui e
have all been slain. There are no waiho nei.”
men left; all are dead.” Aikanaka
then asked: “Whose double
canoe is it?” “When it was in the
sea, we were told that it
belonged to Kamalama; but
when it landed, the large bundle
which we saw on the canoe
turned out to be Kawelo.”

kaihupepenuiamouo kaihupepenuiamouo a
and muno. me muno.

These two men were warriors He mau koa keia no Aikanaka, i


belonging to Aikanaka, and they luna o ka puu o Nounou kahi i
were on the Nounou hill with noho ai. Ia Kaehuikiawakea e
him. While Kaehuikiawakea was olelo ana ia Aikanaka, ku ae la o
speaking to Aikanaka, Kaihupepenuiamouo a me
Kaihupepenuiamouo and Muno Muno, a iho aku la me ko laua
stood up and proceeded down mau lau kanaka elua. A hiki
the hill with their eight hundred lakou i lalo, kaua iho la me
men. Upon their arrival at the Kamalama, a pau loa iho la
bottom of the hill, they were met lakou i ka make ia Kamalama
by Kamalama and his men, and, ma. A koe aku la o
in a very short time, they were all Kaehuikiawakea, hoi aku la ia a
killed with the exception of luna o ka puu o Nounou, olelo
Kaehuikiawakea, who returned aku la ia ia Aikanaka: “Ua pau
to the top of the hill and again loa na kanaka i ka make, a owau
informed Aikanaka of the results, wale no koe. Aohe no kela he
saying, “All the men are slain kaua o lalo, he ahi maoli no. Ina
and I alone am left. That cannot e hou mai o Kamalama i ka ihe
be called a battle; it is like real ana, he umi kanaka e ku i ka
fire. Whenever Kamalama pahu hookahi ana, alaila maalili
throws his spear, it will go ka ihe.”
through about ten men before it
stops.”

walaheeikio and walaheeikio a me


moomooikio. moomooikio.

While Kaehuikiawakea was Ia Kaehuikiawakea e olelo ana ia


relating the outcome of the battle Aikanaka, ku mai la keia mau
to Aikanaka, these two men koa elua a liki i ke kaua me
stood up and after boasting of Kamalama. Iho aku la laua me
what they were going to do to ko laua mau kanaka, hookahi
Kamalama, they proceeded lau.
down the hill with their four
hundred men. At the bottom of Kaua iho la lakou, me
the hill, they were met by Kamalama, Kaeleha, Kalaumeki,
Kamalama, Kaeleha and he mau kanaka ikaika loa laua
Kalaumeki when the fighting ma ke kaua ana. He pololei ka
began. These two men, laua ihe ke o, aole e hala, he
Walaheeikio and Moomooikio, kuku ka ihe, he ku ka puamauu,
were very powerful men and ka naonao, ka nalo, ka ukulele.
were very skilful in the use of the Ma keia kaua ana, ua pau loa na
spear. They could hit a grass kanaka i ka make, a koe no ua
blade, an ant, a fly and even a mau wahi koa nei, a hoomau no
flea. In this battle their men in a laua i ke kaua me Kamalama.
short time were all slain, and the Ma keia kaua ana, ua pa ka lima
two were left alone. They o Kaeleha i ka laau, a emi hope
however continued on the fight mai la, a hoomau aku la o
with Kamalama. Kamalama me Kalaumeki i ke
kaua, a mahope emi mai la o
In this fight, Kaeleha’s hand was Kamalama, a aneane no e
struck by a blow from a club and make, i na wahi koa.
he withdrew, leaving Kamalama
and Kalaumeki to continue the A ike o Kawelo i ka nawaliwali o
conflict. Soon after Kaeleha Kamalama, a i ke koa o
withdrew Kamalama also Kalaumeki alaila, paha mai la o
withdrew, and in fact, he Kawelo, penei:
narrowly escaped being slain by
the two men. When Kawelo saw
that Kamalama was almost
spent and how Kalaumeki
bravely continued with the fight,
he chanted as follows:

When Kalaumeki is passed, Ia hookaa o Kalaumeki i hope,


The sea becomes calm, the Pohu ke kai, malino ke au,
waves become still, Hoolana ka waa i ke po’i,
The canoes are floating in the Nalo koli’a ka puu o Kamae,
line of surf. I ke ehu o na wawae,
The hill of Kamae is become hid Ku aku la i ke kai,
By the dust from the feet. O ua koa nui nei, o Kamalama.
He is beaten by the sea,
The great soldier, Kamalama.

When Kamalama heard this A lohe o Kamalama i keia paha


chant by Kawelo, he became a Kawelo, huhu iho la o
very angry and he returned. Kamalama, a hoi aku la. Ike mai
When Kanewahineikiaoha saw la o Kanewahineikiaoha i ka hoi
Kamalama returning, she said to ana o Kamalama, olelo aku la ia
Kawelo: “Say, I think your ia Kawelo: “E, ua huhu paha ko
younger brother is angry with kaikaina ia oe, ei’ aku la ke hoi
you, for there he is coming mai la.” A ike o Kawelo, paha
back.” When Kawelo saw this, aku la ia penei: [47]
he chanted as follows: [46]

The rain cloud of Koolau is Ea mai ana ke ao ua o Koolau,


making its appearance. Ea mai ana ma Nihoa,
It appears from Nihoa, Ma ka mole mai o Lehua,
From the lower end of Lehua. Ua iho la pulu ke kahawai,
It has rained and the valleys are Pulu a’u lehua i ka makoa,
wet. Kahe ka wai ke hanini nei i kai,
Wet are my lehuas with the He mea e nei wai nui o uka.
makoa rain. Ke o nei ka leo o ka pihaa,
The water is running, it is Na kuu kaikaina punahele
flooding the lowlands, Na ke koa nui, o Kamalama,
The waters from the uplands are E Kamalama kuu pokii e,
raging, Hoi mai, kamau lia.
For the sound from the drift logs Nolaila paha ka ikaika ole.
is heard.
It is caused by my favorite
younger brother,
The great soldier, Kamalama.
Say, my younger brother
Kamalama,
Come back and partake of some
food;
Perchance it has something to
do with thy weakness.

When Kamalama heard this A lohe o Kamalama i keia paha


chant from Kawelo, he turned a Kawelo, huli aku la ia e kaua
around and retraced his steps hou, a loaa aku la o Kalaumeki,
until he met Kalaumeki and kaua iho la lakou, a hee o
again resumed fighting. After a Kamalama ma, a no keia hee
short while, Kamalama and ana, ua hiki ke kaua i ke alo o
companion were routed, and in Kawelo. A hiki o Walaheeikio i
this way the fighting was carried mua o Kawelo, paha aku la o
to the very presence of Kawelo. Kawelo, penei:
Upon the arrival of Walaheeikio
in the presence of Kawelo,
Kawelo chanted as follows: 44

Why not take my sister as your Aia hoi ha kau wahine o kuu
wife, kaikuahine,
The ward of Malaiakalani, O ka hanai a Malaiakalani,
Take her as your wife? O kau wahine ia, e—a?

Walaheeikio then refused to Hoole mai la o Walaheeikio ia


accept the offer made by Kawelo: “Aole paha nau e haawi
Kawelo, saying: “It is not for you mai ka wahine a ke koa; o oe no
to present the warrior with a wife. ka makou a make ae, hai no o
We are going after you until we Aikanaka ia oe i luna o ka lele,
kill you; when you shall be puni no o Kauai nei ia makou, ai
offered by Aikanaka upon the no i kalo moa.” Alaila, paha hou
altar for a sacrifice. Then the aku la o Kawelo, penei:
whole of Kauai shall be ours,
and we will eat the cooked taro.”
Kawelo then chanted as follows:

Why not break the point of your E o la hoi e uhai ka maka o ko


spear then ihe,
And throw it at Kawelo? Alaila, pahu mai ia Kawelo.

Walaheeikio replied: “The point I aku o Walaheeikio: “Aole paha


of my spear shall not be broken e uhai ka maka o ka’u ihe ia oe,
by you; because you stand there no ka mea, o oe no e ku mai nei,
as big as the end of a house, this o ka hakala hale, ua like, aole e
spear will not miss when I throw hala keia ihe ia oe ke pahu aku.”
it at you.” Kawelo then chanted Alaila, paha hou o Kawelo,
back the following: penei:

Why don’t you throw your spear E o la hoi e hou mai ua ihe au,
at me then? A kai ae i ka pola o ka malo,
When I shall let it pass at the A ku aku i ka lepo nui,
end of my loin cloth, Hoi aku a lohe o Aikanaka,
Where it will glance to the great Kahi i noho ai ia Kauai nei,
earth. He mai nui nou ka hilahila.
Then when it is reported to
Aikanaka,
Under whom you are living in
Kauai,
Shame, like sickness, will
overcome you. 45

When the man heard this, he A lohe ua wahi kanaka nei, hou
threw his spear at Kawelo. When mai la ia i kana ihe, a ike o
Kawelo saw the spear coming, Kawelo, hoaka ae la ia i ka ihe i
he struck it with his hand making ka pola o ka malo, a ku aku la ka
it touch the end of his loin cloth, ihe i ka lepo, aole ia Kawelo,
then it glanced to the earth, [49]hilahila iho la, a holo aku la.
missing Kawelo. This so shamed Ma keia holo ana o Walaheeikio,
the man that he immediately mai ke alo aku o Kawelo, hahau
[48]turned and started to run aku la o Kawelo i kana laau ia
away. At this attempt on the part Kuikaa, a make iho la o
of Walaheeikio to escape, Walaheeikio.
Kawelo struck him with his war
club, Kuikaa, killing him instantly.

Upon the death of this warrior, Make kela koa, koe o


Moomooikio came up and took Moomooikio, alaila, paha aku o
his place. When Kawelo saw Kawelo, penei:
him, he chanted as follows: 46

Say, Moomooikio, E Moomooikio—e,


Here, take my wife and let her be Eia kau wahine o kuu wahine,
your wife, O Kanewahineikiaoha,
Kanewahineikiaoha. O kau wahine ia, e—a?
Will you accept her as your wife?

[Here the narrative is the same [Maanei ua like na olelo ana me


as that of the other warrior, that ko kela koa, me ko Walaheeikio,
of Walaheeikio, therefore that nolaila, e waiho i ke kakau ana
part is omitted.] maanei.]

After the death of Walaheeikio A make iho la o Walaheeikio a


and Moomooikio by Kawelo, me Moomooikio ia Kawelo holo
Kaehuikiawakea ran off to the aku la o Kaehuikiawakea a hiki i
top of the Nounou hill and again luna o ka puu o Nounou, olelo
informed Aikanaka of the death aku la ia Aikanaka, i ka make o
of the two warriors. When keia mau koa elua. I mai la o
Aikanaka heard this, he said: “At Aikanaka: “Akahi a komo ke anu
last, the cold feeling has entered ia’u, ua naha aku la ka hale e
me, for the house that has malu ai.”
sheltered me is broken.”

CHAPTER V. MOKUNA V.

Relating to No Kahakaloa.—Kona
Kahakaloa.—His Death Make ana ma o Kawelo
by Kawelo. Ala.

While Kaehuikiawakea was Ia Kaehuikiawakea e olelo ana ia


speaking with Aikanaka, the Aikanaka, ku mai la keia koa o
warrior Kahakaloa, stood up and Kahakaloa a paha, e olelo ana,
chanted his boast that Kawelo aole e pakele o Kawelo ia ia.
will never escape him; Wahi a Kahakaloa: “I nahea ka
continuing, he said: “When did Kawelo ao ana i ke koa, a kakou
Kawelo ever learn the arts of i noho iho nei a holo aku nei i
warfare? While he was here Oahu, a moe aku la i ke
living with us before he sailed for kaikamahine a Kalonaikahailaau;
Oahu, where he married the ina o kana hauna laau a na ka
daughter of Kalonaikahailaau, he makuahunowai ona, aole ia e
knew nothing about fighting. If pakele ia’u. No ka mea, ua kaua
the strokes of the war club no maua me ka makuahunowai
learned by him are those of his ona, ua koele na laau a maua,
father-in-law, then he will never aohe make, aohe make.” A pau
escape me, because I have ka olelo ana a Kahakaloa, iho
fought against his father-in-law mai la ia me kanaha kanaka
and our clubs only tapped one elima, a hiki ia i lalo, kaua iho la
another; he was not killed and I lakou.
was not killed.” When he finished
boasting, he proceeded on down Luku mai la o Kamalama i na
the hill with two hundred men, kanaka a pau loa, a koe o
and when they reached the Kahakaloa, ike aku la o Kawelo
bottom, the fighting began. ia Kahakaloa, paha aku la ia
Kamalama then slew all the men penei:
with the exception of Kahakaloa
whom he did not tackle. When
Kawelo saw Kahakaloa, he
chanted as follows:

The great haka; 47 the small O ka-haka-nui, o ka-haka-iki, o


haka; the long haka; ka-haka-loa,
The haka for the putting up of O ka-haka-kau aipu,
calabashes; Keia la paha e—a?
Perhaps on this day, it shall be
done.

Kahakaloa then said to Kawelo: I mai o Kahakaloa ia Kawelo:


“My name was not given me as a “Aole paha i olelo ia mai ko’u
place to hang up calabashes. inoa o Ka-haka-kau-aipu; o
Kahaka, chief of Kauai, is my Kahaka alii o Kauai nei ko’u
name.” Soon after this, they both inoa.” Ia wa, ku like laua, ku o
stood up, Kawelo with his war Kawelo me kana laau o Kuikaa.
club, Kuikaa, and Kahakaloa Ku no hoi o Kahakaloa me kana
with his war club. They both laau palau, a hoala i na laau
raised their war clubs together. palau a laua, kakii mai la o
Kahakaloa swung his war club Kahakaloa i kana laau palau, a
sideways, hitting Kawelo in the loaa iho la ka a-a o Kawelo,
middle, staggering him. Kawelo newa aku la ia. Ia wa, e hue lepo
then raised his club with a ae ana o Kawelo i kana laau, o
[50]swirl
from the ground, cutting Kuikaa, moku kahi
the small toe, the small finger [51]manamana iki o ka wawae,
and the tip of the ear off the ma ia aoao no, moku ka ili
same side. Kawelo then fell to manamana iki o ka lima, ma ia
the ground and laid there. As aoao hookahi no, moku ka
Kawelo was lying on the ground, welelau o ka pepeiao.
Kaehuikiawakea said to
Kahakaloa: “Strike him another Mahope o laila, haule iho la o
blow, so as to kill him, for I see Kawelo i lalo, a waiho iho la. A
his eyes staring at us.” When waiho o Kawelo i lalo, olelo aku
Kahakaloa heard this, he o Kaehuikiawakea ia Kahakaloa,
answered by chanting the e hahau hou iho oe i laau hou, i
following lines: make loa o Kawelo, eia no la ke
aa mai nei na maka. A lohe o
Kahakaloa i keia mau olelo,
pane mai la ia:

He is dead, for it is the blow from Ua make he laau na ka ui.


the young; Hookahi no laau a ka ui make,
The young makes but one blow O iho auanei a hiki i lalo i o Milu,
to kill, I aku i hahau alua ia e
Else he will go down to Milu 48 Kahakaloa.
And say that he was struck Make ai ke koa nui o Kawelo.
twice 49 by Kahakaloa.
Thus was Kawelo the great
soldier killed.

Kahakaloa then said to I aku o Kahakaloa ia


Kaehuikiawakea: “Let us return Kaehuikiawakea: “E hoi kaua e
and partake of some food and ai a maona, alaila, iho mai au e
when our hunger is satisfied, hoomake i kuu luahi;” alaila, hoi
then I will come down and kill my aku la laua. A hiki laua i luna o
opponent.” 50 The two then ka puu o Nounou, olelo aku la o

You might also like