0% found this document useful (0 votes)
220 views59 pages

Java Programming Joyce Farrell PDF Download

The document provides information on downloading the textbook 'Java Programming' by Joyce Farrell, along with links to various other programming books. It includes details about the content structure, chapters, and copyright information. The textbook is published by Cengage Learning and is available in electronic format with restrictions on copying and distribution.

Uploaded by

trjhzgztn000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
220 views59 pages

Java Programming Joyce Farrell PDF Download

The document provides information on downloading the textbook 'Java Programming' by Joyce Farrell, along with links to various other programming books. It includes details about the content structure, chapters, and copyright information. The textbook is published by Cengage Learning and is available in electronic format with restrictions on copying and distribution.

Uploaded by

trjhzgztn000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 59

Java Programming Joyce Farrell install download

https://textbookfull.com/product/java-programming-joyce-farrell/

Download more ebook instantly today - get yours now at textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Java Programming Joyce Farrell

https://textbookfull.com/product/java-programming-joyce-
farrell-2/

Practical Numerical C Programming 1st Edition Philip


Joyce

https://textbookfull.com/product/practical-numerical-c-
programming-1st-edition-philip-joyce/

Programming in Java Sachin Malhotra

https://textbookfull.com/product/programming-in-java-sachin-
malhotra/

Murach s Java Programming Joel Murach

https://textbookfull.com/product/murach-s-java-programming-joel-
murach/
Practical Numerical C Programming: Finance,
Engineering, and Physics Applications Philip Joyce

https://textbookfull.com/product/practical-numerical-c-
programming-finance-engineering-and-physics-applications-philip-
joyce/

Learning Java An Introduction to Real World Programming


with Java Marc Loy

https://textbookfull.com/product/learning-java-an-introduction-
to-real-world-programming-with-java-marc-loy/

Learning Java Beginning programming with java for


dummies First Edition John Bach

https://textbookfull.com/product/learning-java-beginning-
programming-with-java-for-dummies-first-edition-john-bach/

Java Network Programming Fourth Edition Harold Elliotte

https://textbookfull.com/product/java-network-programming-fourth-
edition-harold-elliotte/

Computer Graphics Programming in OpenGL with Java


Gordon

https://textbookfull.com/product/computer-graphics-programming-
in-opengl-with-java-gordon/
TM

JAVA PROGRAMMING

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
EIGHTH EDITION

TM

JAVA PROGRAMMING

JOYCE FARRELL

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial
review has deemed that any suppressed content does not materially affect the overall learning experience. The publisher reserves the right to
remove content from this title at any time if subsequent rights restrictions require it. For valuable information on pricing, previous
editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by
ISBN#, author, title, or keyword for materials in your areas of interest.

Important Notice: Media content referenced within the product description or the product text may not be available in the eBook version.

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Java Programming, © 2016, 2014, 2012 Cengage Learning
Eighth Edition WCN: 02-200-203
Joyce Farrell
ALL RIGHTS RESERVED. No part of this work covered by the copyright
Product Director: herein may be reproduced, transmitted, stored, or used in any form or
Kathleen McMahon by any means graphic, electronic, or mechanical, including but not
Senior Content Developer: limited to photocopying, recording, scanning, digitizing, taping, Web
Alyssa Pratt distribution, information networks, or information storage and
retrieval systems, except as permitted under Section 107 or 108 of the
Development Editor: Dan Seiter
1976 United States Copyright Act, without the prior written
Marketing Manager: Eric LaScola permission of the publisher.
Manufacturing Planner:
Julio Esperas
For product information and technology assistance, contact us at
Art Director: Jack Pendleton Cengage Learning Customer & Sales Support, 1-800-354-9706
Production Management,
For permission to use material from this text or product,
Copyediting, Composition,
Proofreading, and Indexing: submit all requests online at www.cengage.com/permissions.
Integra Software Services Pvt. Ltd. Further permissions questions can be emailed to
Cover Photo: [email protected].
©Maram/Shutterstock.com

Library of Congress Control Number: 2014956152


ISBN: 978-1-285-85691-9
Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA

Cengage Learning is a leading provider of customized learning


solutions with office locations around the globe, including Singapore,
the United Kingdom, Australia, Mexico, Brazil, and Japan. Locate your
local office at www.cengage.com/global.

Cengage Learning products are represented in Canada by Nelson


Education, Ltd.

All images © 2016 Cengage Learning®. All rights reserved.


To learn more about Cengage Learning Solutions, visit
www.cengage.com.
Purchase any of our products at your local college store
or at our preferred online store www.cengagebrain.com.

Printed in the U nited States of America


Print N umber: 01 Print Year: 2015

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Brief Contents
v

Preface . . . . . . . . . . . . . . . . . . . . . . xxi
CHAPTER 1 Creating Java Programs . . . . . . . . . . . . . . . . 1
CHAPTER 2 Using Data . . . . . . . . . . . . . . . . . . . . . 53
CHAPTER 3 Using Methods, Classes, and Objects . . . . . . . 119
CHAPTER 4 More Object Concepts . . . . . . . . . . . . . . . 183
CHAPTER 5 Making Decisions . . . . . . . . . . . . . . . . . 245
CHAPTER 6 Looping . . . . . . . . . . . . . . . . . . . . . 301
CHAPTER 7 Characters, Strings, and the StringBuilder . . . 353
CHAPTER 8 Arrays . . . . . . . . . . . . . . . . . . . . . . 393
CHAPTER 9 Advanced Array Concepts . . . . . . . . . . . . . 439
CHAPTER 10 Introduction to Inheritance . . . . . . . . . . . . . 491
CHAPTER 11 Advanced Inheritance Concepts . . . . . . . . . . 537
CHAPTER 12 Exception Handling . . . . . . . . . . . . . . . . 593
CHAPTER 13 File Input and Output . . . . . . . . . . . . . . . 665
CHAPTER 14 Introduction to Swing Components . . . . . . . . 729
CHAPTER 15 Advanced GUI Topics . . . . . . . . . . . . . . . 791
CHAPTER 16 Graphics . . . . . . . . . . . . . . . . . . . . . 861
APPENDIX A Working with the Java Platform . . . . . . . . . . . 919
APPENDIX B Data Representation . . . . . . . . . . . . . . . 925
APPENDIX C Formatting Output . . . . . . . . . . . . . . . . 931
APPENDIX D Generating Random Numbers . . . . . . . . . . . 941
APPENDIX E Javadoc . . . . . . . . . . . . . . . . . . . . . 949
Glossary . . . . . . . . . . . . . . . . . . . . 957
Index . . . . . . . . . . . . . . . . . . . . . . 979

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents
vi

Preface . . . . . . . . . . . . . . . . . . xxi

CHAPT ER 1 Creating Java Programs . . . . . . . . . . . 1


Learning Programming Terminology . . . . . . . . . . . . . . 2
Comparing Procedural and Object-Oriented
Programming Concepts . . . . . . . . . . . . . . . . . . 6
Procedural Programming . . . . . . . . . . . . . . . . . . 6
Object-Oriented Programming . . . . . . . . . . . . . . . . 6
Understanding Classes, Objects, and Encapsulation . . . . . . 7
Understanding Inheritance and Polymorphism . . . . . . . . . 9
Features of the Java Programming Language . . . . . . . . . . 11
Java Program Types . . . . . . . . . . . . . . . . . . . . 12
Analyzing a Java Application that Produces Console Output . . . . 13
Understanding the Statement that Produces the Output . . . . . 14
Understanding the First Class . . . . . . . . . . . . . . . 15
Indent Style . . . . . . . . . . . . . . . . . . . . . . . 18
Understanding the main() Method . . . . . . . . . . . . . 19
Saving a Java Class . . . . . . . . . . . . . . . . . . . . 21
Compiling a Java Class and Correcting Syntax Errors . . . . . . . 23
Compiling a Java Class . . . . . . . . . . . . . . . . . . . 23
Correcting Syntax Errors . . . . . . . . . . . . . . . . . . 24
Running a Java Application and Correcting Logic Errors . . . . . . 29
Running a Java Application . . . . . . . . . . . . . . . . . 29
Modifying a Compiled Java Class . . . . . . . . . . . . . . 30
Correcting Logic Errors . . . . . . . . . . . . . . . . . . 31
Adding Comments to a Java Class . . . . . . . . . . . . . . . 32
Creating a Java Application that Produces GUI Output . . . . . . 35
Finding Help . . . . . . . . . . . . . . . . . . . . . . . . 38
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . . 39
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . . 41

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Chapter Summary . . . . . . . . . . . . . . . . . . . . . . 45
Review Questions . . . . . . . . . . . . . . . . . . . . . . 46
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . 48
Programming Exercises . . . . . . . . . . . . . . . . . . 48
Debugging Exercises . . . . . . . . . . . . . . . . . . . 50 vii
Game Zone . . . . . . . . . . . . . . . . . . . . . . . . 50
Case Problems . . . . . . . . . . . . . . . . . . . . . . 51

CHAPT ER 2 Using Data . . . . . . . . . . . . . . . . . 53


Declaring and Using Constants and Variables . . . . . . . . . . 54
Declaring Variables . . . . . . . . . . . . . . . . . . . . 55
Declaring Named Constants . . . . . . . . . . . . . . . . 56
The Scope of Variables and Constants . . . . . . . . . . . . 58
Concatenating Strings to Variables and Constants . . . . . . . 58
Pitfall: Forgetting that a Variable Holds
One Value at a Time . . . . . . . . . . . . . . . . . . . 60
Learning About Integer Data Types . . . . . . . . . . . . . . 64
Using the boolean Data Type . . . . . . . . . . . . . . . . . 70
Learning About Floating-Point Data Types . . . . . . . . . . . . 71
Using the char Data Type . . . . . . . . . . . . . . . . . . 72
Using the Scanner Class to Accept Keyboard Input . . . . . . . 78
Pitfall: Using nextLine() Following One of the
Other Scanner Input Methods . . . . . . . . . . . . . . 81
Using the JOptionPane Class to Accept GUI Input . . . . . . . 87
Using Input Dialog Boxes . . . . . . . . . . . . . . . . . . 87
Using Confirm Dialog Boxes . . . . . . . . . . . . . . . . 91
Performing Arithmetic . . . . . . . . . . . . . . . . . . . . 93
Associativity and Precedence . . . . . . . . . . . . . . . . 95
Writing Arithmetic Statements Efficiently . . . . . . . . . . . 96
Pitfall: Not Understanding Imprecision
in Floating-Point Numbers . . . . . . . . . . . . . . . . 96
Understanding Type Conversion . . . . . . . . . . . . . . . 101
Automatic Type Conversion . . . . . . . . . . . . . . . . 101
Explicit Type Conversions . . . . . . . . . . . . . . . . 102
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 106
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 107

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Chapter Summary . . . . . . . . . . . . . . . . . . . . . 111


Review Questions . . . . . . . . . . . . . . . . . . . . . 111
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 114
Programming Exercises . . . . . . . . . . . . . . . . . 114
viii Debugging Exercises . . . . . . . . . . . . . . . . . . 116
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 117
Case Problems . . . . . . . . . . . . . . . . . . . . . 118

CHAPT ER 3 Using Methods, Classes, and Objects . . . . 119


Understanding Method Calls and Placement . . . . . . . . . . 120
Understanding Method Construction . . . . . . . . . . . . . 123
Access Specifiers . . . . . . . . . . . . . . . . . . . . 123
Return Type . . . . . . . . . . . . . . . . . . . . . . 124
Method Name . . . . . . . . . . . . . . . . . . . . . 125
Parentheses . . . . . . . . . . . . . . . . . . . . . . 125
Adding Parameters to Methods . . . . . . . . . . . . . . . 129
Creating a Method that Receives a Single Parameter . . . . . 130
Creating a Method that Requires Multiple Parameters . . . . . 133
Creating Methods that Return Values . . . . . . . . . . . . . 136
Chaining Method Calls . . . . . . . . . . . . . . . . . . 138
Learning About Classes and Objects . . . . . . . . . . . . . 142
Creating a Class . . . . . . . . . . . . . . . . . . . . . 145
Creating Instance Methods in a Class . . . . . . . . . . . . 147
Organizing Classes . . . . . . . . . . . . . . . . . . . 150
Declaring Objects and Using their Methods . . . . . . . . . . 154
Understanding Data Hiding . . . . . . . . . . . . . . . . 156
An Introduction to Using Constructors . . . . . . . . . . . . 159
Understanding that Classes Are Data Types . . . . . . . . . . 163
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 168
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 168
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 170
Review Questions . . . . . . . . . . . . . . . . . . . . . 171
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 174
Programming Exercises . . . . . . . . . . . . . . . . . 174
Debugging Exercises . . . . . . . . . . . . . . . . . . 177
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 178
Case Problems . . . . . . . . . . . . . . . . . . . . . 179

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPT ER 4 More Object Concepts . . . . . . . . . . . 183
Understanding Blocks and Scope . . . . . . . . . . . . . . 184
Overloading a Method . . . . . . . . . . . . . . . . . . . 192
Automatic Type Promotion in Method Calls . . . . . . . . . 194
Learning About Ambiguity . . . . . . . . . . . . . . . . . 199 ix

Creating and Calling Constructors with Parameters . . . . . . . 200


Overloading Constructors . . . . . . . . . . . . . . . . 201
Learning About the this Reference . . . . . . . . . . . . . 205
Using the this Reference to Make Overloaded Constructors
More Efficient . . . . . . . . . . . . . . . . . . . . . 209
Using static Fields . . . . . . . . . . . . . . . . . . . 213
Using Constant Fields . . . . . . . . . . . . . . . . . . 215
Using Automatically Imported, Prewritten Constants
and Methods . . . . . . . . . . . . . . . . . . . . . . 220
The Math Class . . . . . . . . . . . . . . . . . . . . 221
Importing Classes that Are Not Imported Automatically . . . . 223
Using the LocalDate Class . . . . . . . . . . . . . . . 224
Understanding Composition and Nested Classes . . . . . . . . 230
Composition . . . . . . . . . . . . . . . . . . . . . . 230
Nested Classes . . . . . . . . . . . . . . . . . . . . . 232
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 234
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 234
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 236
Review Questions . . . . . . . . . . . . . . . . . . . . . 236
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 239
Programming Exercises . . . . . . . . . . . . . . . . . 239
Debugging Exercises . . . . . . . . . . . . . . . . . . 242
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 242
Case Problems . . . . . . . . . . . . . . . . . . . . . 243

CHAPT ER 5 Making Decisions . . . . . . . . . . . . . 245


Planning Decision-Making Logic . . . . . . . . . . . . . . . 246
The if and if…else Statements . . . . . . . . . . . . . . 248
The if Statement . . . . . . . . . . . . . . . . . . . . 248
Pitfall: Misplacing a Semicolon in an if Statement . . . . . . 249
Pitfall: Using the Assignment Operator Instead
of the Equivalency Operator . . . . . . . . . . . . . . 250

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Pitfall: Attempting to Compare Objects


Using the Relational Operators . . . . . . . . . . . . . 251
The if…else Statement . . . . . . . . . . . . . . . . . 251
Using Multiple Statements in if and if…else Clauses . . . . 254
x Nesting if and if…else Statements . . . . . . . . . . . . 260
Using Logical AND and OR Operators . . . . . . . . . . . . 263
The AND Operator . . . . . . . . . . . . . . . . . . . . 263
The OR Operator . . . . . . . . . . . . . . . . . . . . 265
Short-Circuit Evaluation . . . . . . . . . . . . . . . . . . 266
Making Accurate and Efficient Decisions . . . . . . . . . . . 269
Making Accurate Range Checks . . . . . . . . . . . . . . 270
Making Efficient Range Checks . . . . . . . . . . . . . . 272
Using && and || Appropriately . . . . . . . . . . . . . . 273
Using the switch Statement . . . . . . . . . . . . . . . . 274
Using the Conditional and NOT Operators . . . . . . . . . . . 280
Using the NOT Operator . . . . . . . . . . . . . . . . . 281
Understanding Operator Precedence . . . . . . . . . . . . . 282
Adding Decisions and Constructors
to Instance Methods . . . . . . . . . . . . . . . . . . . 285
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 289
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 289
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 291
Review Questions . . . . . . . . . . . . . . . . . . . . . 291
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 294
Programming Exercises . . . . . . . . . . . . . . . . . 294
Debugging Exercises . . . . . . . . . . . . . . . . . . 297
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 297
Case Problems . . . . . . . . . . . . . . . . . . . . . 299

CHAPT ER 6 Looping . . . . . . . . . . . . . . . . . 301


Learning About the Loop Structure . . . . . . . . . . . . . . 302
Creating while Loops . . . . . . . . . . . . . . . . . . 303
Writing a Definite while Loop . . . . . . . . . . . . . . 303
Pitfall: Failing to Alter the Loop Control Variable
Within the Loop Body . . . . . . . . . . . . . . . . . 305
Pitfall: Unintentionally Creating a Loop with
an Empty Body . . . . . . . . . . . . . . . . . . . . 306

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Altering a Definite Loop’s Control Variable . . . . . . . . . . 307
Writing an Indefinite while Loop . . . . . . . . . . . . . 308
Validating Data . . . . . . . . . . . . . . . . . . . . . 310
Using Shortcut Arithmetic Operators . . . . . . . . . . . . . 314
Creating a for Loop . . . . . . . . . . . . . . . . . . . 319 xi
Unconventional for Loops . . . . . . . . . . . . . . . . 320
Learning How and When to Use a do…while Loop . . . . . . 325
Learning About Nested Loops . . . . . . . . . . . . . . . . 328
Improving Loop Performance . . . . . . . . . . . . . . . . 333
Avoiding Unnecessary Operations . . . . . . . . . . . . . 333
Considering the Order of Evaluation of Short-Circuit
Operators . . . . . . . . . . . . . . . . . . . . . . 334
Comparing to Zero . . . . . . . . . . . . . . . . . . . 334
Employing Loop Fusion . . . . . . . . . . . . . . . . . . 336
Using Prefix Incrementing Rather than Postfix
Incrementing . . . . . . . . . . . . . . . . . . . . . 337
A Final Note on Improving Loop Performance . . . . . . . . 338
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 342
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 342
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 344
Review Questions . . . . . . . . . . . . . . . . . . . . . 344
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 347
Programming Exercises . . . . . . . . . . . . . . . . . 347
Debugging Exercises . . . . . . . . . . . . . . . . . . 350
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 350
Case Problems . . . . . . . . . . . . . . . . . . . . . 352

CHAPT ER 7 Characters, Strings, and


the StringBuilder . . . . . . . . . . . . 353
Understanding String Data Problems . . . . . . . . . . . . . 354
Using Character Class Methods . . . . . . . . . . . . . . 355
Declaring and Comparing String Objects . . . . . . . . . . 359
Comparing String Values . . . . . . . . . . . . . . . . 359
Empty and null Strings . . . . . . . . . . . . . . . . . 363
Using Other String Methods . . . . . . . . . . . . . . . 365
Converting String Objects to Numbers . . . . . . . . . . 369

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Learning About the StringBuilder


and StringBuffer Classes . . . . . . . . . . . . . . 374
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 381
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 382
xii Chapter Summary . . . . . . . . . . . . . . . . . . . . . 382
Review Questions . . . . . . . . . . . . . . . . . . . . . 383
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 385
Programming Exercises . . . . . . . . . . . . . . . . . 385
Debugging Exercises . . . . . . . . . . . . . . . . . . 388
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 388
Case Problems . . . . . . . . . . . . . . . . . . . . . 391

CHAPT ER 8 Arrays . . . . . . . . . . . . . . . . . . 393


Declaring Arrays . . . . . . . . . . . . . . . . . . . . . 394
Initializing an Array . . . . . . . . . . . . . . . . . . . . 399
Using Variable Subscripts with an Array . . . . . . . . . . . . 402
Using the Enhanced for Loop . . . . . . . . . . . . . . 403
Using Part of an Array . . . . . . . . . . . . . . . . . . 404
Declaring and Using Arrays of Objects . . . . . . . . . . . . 406
Using the Enhanced for Loop with Objects . . . . . . . . . 408
Manipulating Arrays of Strings . . . . . . . . . . . . . 408
Searching an Array and Using Parallel Arrays . . . . . . . . . 414
Using Parallel Arrays . . . . . . . . . . . . . . . . . . . 415
Searching an Array for a Range Match . . . . . . . . . . . 418
Passing Arrays to and Returning Arrays from Methods . . . . . 422
Returning an Array from a Method . . . . . . . . . . . . . 426
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 428
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 428
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 429
Review Questions . . . . . . . . . . . . . . . . . . . . . 430
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 433
Programming Exercises . . . . . . . . . . . . . . . . . 433
Debugging Exercises . . . . . . . . . . . . . . . . . . 435
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 435
Case Problems . . . . . . . . . . . . . . . . . . . . . 438

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPT ER 9 Advanced Array Concepts . . . . . . . . . 439
Sorting Array Elements Using the Bubble Sort Algorithm . . . . 440
Using the Bubble Sort Algorithm . . . . . . . . . . . . . . 440
Improving Bubble Sort Efficiency . . . . . . . . . . . . . 442
Sorting Arrays of Objects . . . . . . . . . . . . . . . . . 443 xiii

Sorting Array Elements Using the Insertion Sort Algorithm . . . . 448


Using Two-Dimensional and Other Multidimensional Arrays . . . . 452
Passing a Two-Dimensional Array to a Method . . . . . . . . 454
Using the length Field with a Two-Dimensional Array . . . . 455
Understanding Ragged Arrays . . . . . . . . . . . . . . . 456
Using Other Multidimensional Arrays . . . . . . . . . . . . 456
Using the Arrays Class . . . . . . . . . . . . . . . . . . 459
Using the ArrayList Class . . . . . . . . . . . . . . . . 467
Creating Enumerations . . . . . . . . . . . . . . . . . . . 472
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 479
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 479
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 480
Review Questions . . . . . . . . . . . . . . . . . . . . . 481
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 484
Programming Exercises . . . . . . . . . . . . . . . . . 484
Debugging Exercises . . . . . . . . . . . . . . . . . . 486
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 487
Case Problems . . . . . . . . . . . . . . . . . . . . . 490

CHAPT ER 10 Introduction to Inheritance . . . . . . . . . 491


Learning About the Concept of Inheritance . . . . . . . . . . 492
Diagramming Inheritance Using the UML . . . . . . . . . . 492
Inheritance Terminology . . . . . . . . . . . . . . . . . 495
Extending Classes . . . . . . . . . . . . . . . . . . . . . 496
Overriding Superclass Methods . . . . . . . . . . . . . . . 502
Using the @Override Tag . . . . . . . . . . . . . . . . 504
Calling Constructors During Inheritance . . . . . . . . . . . . 507
Using Superclass Constructors that
Require Arguments . . . . . . . . . . . . . . . . . . 508
Accessing Superclass Methods . . . . . . . . . . . . . . . 513
Comparing this and super . . . . . . . . . . . . . . . 515
Employing Information Hiding . . . . . . . . . . . . . . . . 516

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Methods You Cannot Override . . . . . . . . . . . . . . . . 518


A Subclass Cannot Override static Methods in
Its Superclass . . . . . . . . . . . . . . . . . . . . 518
A Subclass Cannot Override final Methods in
Its Superclass . . . . . . . . . . . . . . . . . . . . 522
xiv
A Subclass Cannot Override Methods
in a final Superclass . . . . . . . . . . . . . . . . 523
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 525
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 525
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 526
Review Questions . . . . . . . . . . . . . . . . . . . . . 527
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 530
Programming Exercises . . . . . . . . . . . . . . . . . 530
Debugging Exercises . . . . . . . . . . . . . . . . . . 533
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 534
Case Problems . . . . . . . . . . . . . . . . . . . . . 535

CHAPT ER 11 Advanced Inheritance Concepts . . . . . . . 537


Creating and Using Abstract Classes . . . . . . . . . . . . . 538
Using Dynamic Method Binding . . . . . . . . . . . . . . . 547
Using a Superclass as a Method Parameter Type . . . . . . 549
Creating Arrays of Subclass Objects . . . . . . . . . . . . . 551
Using the Object Class and Its Methods . . . . . . . . . . . 554
Using the toString() Method . . . . . . . . . . . . . 556
Using the equals() Method . . . . . . . . . . . . . . . 559
Using Inheritance to Achieve Good Software Design . . . . . . 564
Creating and Using Interfaces . . . . . . . . . . . . . . . . 565
Creating Interfaces to Store Related Constants . . . . . . . 570
Creating and Using Packages . . . . . . . . . . . . . . . . 574
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 580
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 580
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 581
Review Questions . . . . . . . . . . . . . . . . . . . . . 582
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 585
Programming Exercises . . . . . . . . . . . . . . . . . 585
Debugging Exercises . . . . . . . . . . . . . . . . . . 589
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 590
Case Problems . . . . . . . . . . . . . . . . . . . . . 590
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CHAPT ER 12 Exception Handling . . . . . . . . . . . . 593
Learning About Exceptions . . . . . . . . . . . . . . . . . 594
Trying Code and Catching Exceptions . . . . . . . . . . . . 599
Using a try Block to Make Programs “Foolproof” . . . . . . 604
Declaring and Initializing Variables in try…catch Blocks . . . 606 xv

Throwing and Catching Multiple Exceptions . . . . . . . . . . 609


Using the finally Block . . . . . . . . . . . . . . . . . 615
Understanding the Advantages of Exception Handling . . . . . . 618
Specifying the Exceptions that a Method Can Throw . . . . . . 621
Tracing Exceptions Through the Call Stack . . . . . . . . . . 626
Creating Your Own Exception Classes . . . . . . . . . . . 630
Using Assertions . . . . . . . . . . . . . . . . . . . . . 634
Displaying the Virtual Keyboard . . . . . . . . . . . . . . . 650
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 653
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 654
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 655
Review Questions . . . . . . . . . . . . . . . . . . . . . 656
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 659
Programming Exercises . . . . . . . . . . . . . . . . . 659
Debugging Exercises . . . . . . . . . . . . . . . . . . 662
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 662
Case Problems . . . . . . . . . . . . . . . . . . . . . 663

CHAPT ER 13 File Input and Output . . . . . . . . . . . . 665


Understanding Computer Files . . . . . . . . . . . . . . . 666
Using the Path and Files Classes . . . . . . . . . . . . . 667
Creating a Path . . . . . . . . . . . . . . . . . . . . . 668
Retrieving Information About a Path . . . . . . . . . . . . 669
Converting a Relative Path to an Absolute One . . . . . . . . 670
Checking File Accessibility . . . . . . . . . . . . . . . . 671
Deleting a Path . . . . . . . . . . . . . . . . . . . . . 673
Determining File Attributes . . . . . . . . . . . . . . . . 674
File Organization, Streams, and Buffers . . . . . . . . . . . . 678
Using Java’s IO Classes . . . . . . . . . . . . . . . . . . 680
Writing to a File . . . . . . . . . . . . . . . . . . . . . 683
Reading from a File . . . . . . . . . . . . . . . . . . . 685

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Creating and Using Sequential Data Files . . . . . . . . . . . 687


Learning About Random Access Files . . . . . . . . . . . . 693
Writing Records to a Random Access Data File . . . . . . . . 697
Reading Records from a Random Access Data File . . . . . . . 704
xvi Accessing a Random Access File Sequentially . . . . . . . . 704
Accessing a Random Access File Randomly . . . . . . . . . 705
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 719
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 719
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 720
Review Questions . . . . . . . . . . . . . . . . . . . . . 721
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 724
Programming Exercises . . . . . . . . . . . . . . . . . 724
Debugging Exercises . . . . . . . . . . . . . . . . . . 726
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 727
Case Problems . . . . . . . . . . . . . . . . . . . . . 727

CHAPT ER 14 Introduction to Swing Components . . . . . 729


Understanding Swing Components . . . . . . . . . . . . . 730
Using the JFrame Class . . . . . . . . . . . . . . . . . . 731
Customizing a JFrame’s Appearance . . . . . . . . . . . 734
Using the JLabel Class . . . . . . . . . . . . . . . . . . 738
Changing a JLabel’s Font . . . . . . . . . . . . . . . . 740
Using a Layout Manager . . . . . . . . . . . . . . . . . . 743
Extending the JFrame Class . . . . . . . . . . . . . . . . 746
Adding JTextFields, JButtons, and Tool Tips to a
JFrame . . . . . . . . . . . . . . . . . . . . . . . . 748
Adding JTextFields . . . . . . . . . . . . . . . . . . 748
Adding JButtons . . . . . . . . . . . . . . . . . . . 750
Using Tool Tips . . . . . . . . . . . . . . . . . . . . . 752
Learning About Event-Driven Programming . . . . . . . . . . 755
Preparing Your Class to Accept Event Messages . . . . . . . 756
Telling Your Class to Expect Events to Happen . . . . . . . 757
Telling Your Class How to Respond to Events . . . . . . . . 757
An Event-Driven Program . . . . . . . . . . . . . . . . . 757
Using Multiple Event Sources . . . . . . . . . . . . . . . 759
Using the setEnabled() Method . . . . . . . . . . . . 761
Understanding Swing Event Listeners . . . . . . . . . . . . 764

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Using the JCheckBox, ButtonGroup, and JComboBox
Classes . . . . . . . . . . . . . . . . . . . . . . . . 767
The JCheckBox Class . . . . . . . . . . . . . . . . . 767
The ButtonGroup Class . . . . . . . . . . . . . . . . 771
The JComboBox Class . . . . . . . . . . . . . . . . . 772 xvii
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 780
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 780
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 781
Review Questions . . . . . . . . . . . . . . . . . . . . . 783
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 785
Programming Exercises . . . . . . . . . . . . . . . . . 785
Debugging Exercises . . . . . . . . . . . . . . . . . . 787
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 787
Case Problems . . . . . . . . . . . . . . . . . . . . . 788

CHAPT ER 15 Advanced GUI Topics . . . . . . . . . . . 791


Understanding the Content Pane . . . . . . . . . . . . . . 792
Using Color . . . . . . . . . . . . . . . . . . . . . . . 795
Learning More About Layout Managers . . . . . . . . . . . . 797
Using BorderLayout . . . . . . . . . . . . . . . . . 798
Using FlowLayout . . . . . . . . . . . . . . . . . . . 800
Using GridLayout . . . . . . . . . . . . . . . . . . . 802
Using CardLayout . . . . . . . . . . . . . . . . . . . 803
Using Advanced Layout Managers . . . . . . . . . . . . . 805
Using the JPanel Class . . . . . . . . . . . . . . . . . . 813
Creating JScrollPanes . . . . . . . . . . . . . . . . . 821
A Closer Look at Events and Event Handling . . . . . . . . . . 824
An Event-Handling Example: KeyListener . . . . . . . . 827
Using AWTEvent Class Methods . . . . . . . . . . . . . . 830
Understanding x- and y-Coordinates . . . . . . . . . . . . 832
Handling Mouse Events . . . . . . . . . . . . . . . . . . 832
Using Menus . . . . . . . . . . . . . . . . . . . . . . . 837
Using Specialized Menu Items . . . . . . . . . . . . . . . 841
Using addSeparator() . . . . . . . . . . . . . . . . 843
Using setMnemonic() . . . . . . . . . . . . . . . . . 843
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 848
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 849

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

Chapter Summary . . . . . . . . . . . . . . . . . . . . . 850


Review Questions . . . . . . . . . . . . . . . . . . . . . 851
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 853
Programming Exercises . . . . . . . . . . . . . . . . . 853
xviii Debugging Exercises . . . . . . . . . . . . . . . . . . 855
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 855
Case Problems . . . . . . . . . . . . . . . . . . . . . 859

CHAPT ER 16 Graphics . . . . . . . . . . . . . . . . . 861


Learning About Rendering Methods . . . . . . . . . . . . . 862
Drawing Strings . . . . . . . . . . . . . . . . . . . . . . 865
Repainting . . . . . . . . . . . . . . . . . . . . . . . 867
Setting a Font . . . . . . . . . . . . . . . . . . . . . 869
Using Color . . . . . . . . . . . . . . . . . . . . . . 870
Drawing Lines and Shapes . . . . . . . . . . . . . . . . . 874
Drawing Lines . . . . . . . . . . . . . . . . . . . . . 874
Drawing Unfilled and Filled Rectangles . . . . . . . . . . . 875
Drawing Clear Rectangles . . . . . . . . . . . . . . . . 875
Drawing Rounded Rectangles . . . . . . . . . . . . . . . 876
Drawing Shadowed Rectangles . . . . . . . . . . . . . . 878
Drawing Ovals . . . . . . . . . . . . . . . . . . . . . 879
Drawing Arcs . . . . . . . . . . . . . . . . . . . . . . 880
Creating Polygons . . . . . . . . . . . . . . . . . . . . 881
Copying an Area . . . . . . . . . . . . . . . . . . . . 883
Using the paint() Method with JFrames . . . . . . . . . 883
Learning More About Fonts . . . . . . . . . . . . . . . . . 891
Discovering Screen Statistics . . . . . . . . . . . . . . . 893
Discovering Font Statistics . . . . . . . . . . . . . . . . 894
Drawing with Java 2D Graphics . . . . . . . . . . . . . . . 898
Specifying the Rendering Attributes . . . . . . . . . . . . 899
Setting a Drawing Stroke . . . . . . . . . . . . . . . . . 901
Creating Objects to Draw . . . . . . . . . . . . . . . . . 902
Don’t Do It . . . . . . . . . . . . . . . . . . . . . . . . 910
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 911
Chapter Summary . . . . . . . . . . . . . . . . . . . . . 911
Review Questions . . . . . . . . . . . . . . . . . . . . . 912
Exercises . . . . . . . . . . . . . . . . . . . . . . . . 915

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Programming Exercises . . . . . . . . . . . . . . . . . 915
Debugging Exercises . . . . . . . . . . . . . . . . . . 916
Game Zone . . . . . . . . . . . . . . . . . . . . . . . 916
Case Problems . . . . . . . . . . . . . . . . . . . . . 918
xix
APPENDIX A Working with the Java Platform . . . . . . . 919
Learning about the Java SE Development Kit . . . . . . . . . 920
Configuring Windows to Use the JDK . . . . . . . . . . . . . 920
Finding the Command Prompt . . . . . . . . . . . . . . . 921
Command Prompt Anatomy . . . . . . . . . . . . . . . . 921
Changing Directories . . . . . . . . . . . . . . . . . . 921
Setting the class and classpath Variables . . . . . . . 922
Changing a File’s Name . . . . . . . . . . . . . . . . . 922
Compiling and Executing a Java Program . . . . . . . . . . . 923
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 923

APPENDIX B Data Representation . . . . . . . . . . . . 925


Understanding Numbering Systems . . . . . . . . . . . . . 926
Representing Numeric Values . . . . . . . . . . . . . . . . 927
Representing Character Values . . . . . . . . . . . . . . . 929
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 930

APPENDIX C Formatting Output . . . . . . . . . . . . . 931


Rounding Numbers . . . . . . . . . . . . . . . . . . . . 932
Using the printf() Method . . . . . . . . . . . . . . . . 933
Specifying a Number of Decimal Places to
Display with printf() . . . . . . . . . . . . . . . . 936
Specifying a Field Size with printf() . . . . . . . . . . . 937
Using the Optional Argument Index with printf() . . . . . 938
Using the DecimalFormat Class . . . . . . . . . . . . . 939
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 940

APPENDIX D Generating Random Numbers . . . . . . . . 941


Understanding Computer-Generated Random Numbers . . . . . 942
Using the Math.random() Method . . . . . . . . . . . . . 943
Using the Random Class . . . . . . . . . . . . . . . . . . 944
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 947

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
CONTENTS

APPENDIX E Javadoc . . . . . . . . . . . . . . . . . 949


The Javadoc Documentation Generator . . . . . . . . . . . . 950
Javadoc Comment Types . . . . . . . . . . . . . . . . . . 950
Generating Javadoc Documentation . . . . . . . . . . . . . 952
xx Specifying Visibility of Javadoc Documentation . . . . . . . . 955
Key Terms . . . . . . . . . . . . . . . . . . . . . . . . 956

Glossary . . . . . . . . . . . . . . . . . 957
Index . . . . . . . . . . . . . . . . . . . 979

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface
xxi

Java Programming, Eighth Edition, provides the beginning programmer with a guide to
developing applications using the Java programming language. Java is popular among
professional programmers because it can be used to build visually interesting graphical user
interface (GUI) and Web-based applications. Java also provides an excellent environment for
the beginning programmer—a student can quickly build useful programs while learning the
basics of structured and object-oriented programming techniques.
This textbook assumes that you have little or no programming experience. It provides a solid
background in good object-oriented programming techniques and introduces terminology
using clear, familiar language. The programming examples are business examples; they do not
assume a mathematical background beyond high-school business math. In addition, the
examples illustrate only one or two major points; they do not contain so many features that
you become lost following irrelevant and extraneous details. Complete, working programs
appear frequently in each chapter; these examples help students make the transition from the
theoretical to the practical. The code presented in each chapter can also be downloaded from
the publisher’s Web site, so students can easily run the programs and experiment with
changes to them.
The student using Java Programming, Eighth Edition, builds applications from the bottom up
rather than starting with existing objects. This facilitates a deeper understanding of the
concepts used in object-oriented programming and engenders appreciation for the existing
objects students use as their knowledge of the language advances. When students complete
this book, they will know how to modify and create simple Java programs, and they will have
the tools to create more complex examples. They also will have a fundamental knowledge of
object-oriented programming, which will serve them well in advanced Java courses or in
studying other object-oriented languages such as C++, C#, and Visual Basic.

Organization and Coverage


Java Programming, Eighth Edition, presents Java programming concepts, enforcing good
style, logical thinking, and the object-oriented paradigm. Objects are covered right from the
beginning, earlier than in many other textbooks. You create your first Java program in
Chapter 1. Chapters 2, 3, and 4 increase your understanding of how data, classes, objects,
and methods interact in an object-oriented environment.
Chapters 5 and 6 explore input and repetition structures, which are the backbone of
programming logic and essential to creating useful programs in any language. You learn the
special considerations of string and array manipulation in Chapters 7, 8, and 9.

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE Features

Chapters 10, 11, and 12 thoroughly cover inheritance and exception handling. Inheritance is
the object-oriented concept that allows you to develop new objects quickly by adapting the
features of existing objects; exception handling is the object-oriented approach to handling
errors. Both are important concepts in object-oriented design. Chapter 13 provides
information on handling files so you can permanently store and retrieve program output.
xxii
Chapters 14, 15, and 16 introduce GUI Swing components (Java’s visually pleasing,
user-friendly widgets), their layout managers, and graphics.

Features
The following features are new for the Eighth Edition:
JAVA 8E: All programs have been tested using Java 8e, the newest edition of Java.
WINDOWS 8.1: All programs have been tested in Windows 8.1, and all screen shots have
been taken in this new environment.
DATE AND TIME CLASSES: This edition provides thorough coverage of the java.time
package, which is new in Java 8e.
ON-SCREEN KEYBOARD: This edition provides instructions for displaying and using an
on-screen keyboard with either a touch screen or a standard screen.
MODERNIZED GRAPHICS OUTPUT: The chapter on graphics (Chapter 16) has been
completely rewritten to focus on Swing component graphics production using the
paintComponent() method.

MODERNIZED OVERRIDING: The @Override tag is introduced.


EXPANDED COVERAGE OF THE EQUALS() METHOD: The book provides a thorough
explanation of the difference between overloading and overriding the equals() method.
PROGRAMMING EXERCISES: Each chapter contains several new programming exercises
not seen in previous editions. All exercises and their solutions from the previous edition
that were replaced in this edition are still available in the Instructor’s Resource Kit.
Additionally, Java Programming, Eighth Edition, includes the following features:
OBJECTIVES: Each chapter begins with a list of objectives so you know the topics that will
be presented in the chapter. In addition to providing a quick reference to topics covered,
this feature provides a useful study aid.
YOU DO IT: In each chapter, step-by-step exercises help students create multiple working
programs that emphasize the logic a programmer uses in choosing statements to include.
These sections provide a means for students to achieve success on their own—even those
in online or distance learning classes.
NOTES: These highlighted tips provide additional information—for example, an
alternative method of performing a procedure, another term for a concept, background
information on a technique, or a common error to avoid.

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Features

EMPHASIS ON STUDENT RESEARCH: The student frequently is directed to the Java Web
site to investigate classes and methods. Computer languages evolve, and programming
professionals must understand how to find the latest language improvements. This book
encourages independent research.
FIGURES: Each chapter contains many figures. Code figures are most frequently 25 lines
xxiii
or fewer, illustrating one concept at a time. Frequent screen shots show exactly how
program output appears. Callouts appear where needed to emphasize a point.
COLOR: The code figures in each chapter contain all Java keywords in blue. This helps
students identify keywords more easily, distinguishing them from programmer-selected
names.
FILES: More than 200 student files can be downloaded from the publisher’s Web site. Most
files contain the code presented in the figures in each chapter; students can run the code for
themselves, view the output, and make changes to the code to observe the effects. Other
files include debugging exercises that help students improve their programming skills.
TWO TRUTHS & A LIE: A short quiz reviews each chapter section, with answers provided.
This quiz contains three statements based on the preceding section of text—two
statements are true and one is false. Over the years, students have requested answers to
problems, but we have hesitated to distribute them in case instructors want to use
problems as assignments or test questions. These true–false quizzes provide students with
immediate feedback as they read, without “giving away” answers to the multiple-choice
questions and programming exercises.
DON’T DO IT: This section at the end of each chapter summarizes common mistakes and
pitfalls that plague new programmers while learning the current topic.
KEY TERMS: Each chapter includes a list of newly introduced vocabulary, shown in the
order of appearance in the text. The list of key terms provides a short review of the major
concepts in the chapter.
SUMMARIES: Following each chapter is a summary that recaps the programming
concepts and techniques covered in the chapter. This feature provides a concise means for
students to check their understanding of the main points in each chapter.
REVIEW QUESTIONS: Each chapter includes 20 multiple-choice questions that serve as a
review of chapter topics.
GAME ZONE: Each chapter provides one or more exercises in which students can create
interactive games using the programming techniques learned up to that point; 70 game
programs are suggested in the book. The games are fun to create and play; writing them
motivates students to master the necessary programming techniques. Students might
exchange completed game programs with each other, suggesting improvements and
discovering alternate ways to accomplish tasks.
CASES: Each chapter contains two running case problems. These cases represent projects
that continue to grow throughout a semester using concepts learned in each new chapter.
Two cases allow instructors to assign different cases in alternate semesters or to divide
students in a class into two case teams.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
PREFACE Instructor Resources

GLOSSARY: This edition contains an alphabetized list of all key terms identified in the
book, along with their definitions.
APPENDICES: This edition includes useful appendices on working with the Java platform,
data representation, formatting output, generating random numbers, and creating Javadoc
comments.
xxiv
QUALITY: Every program example, exercise, and game solution was tested by the author
and then tested again by a quality assurance team using Java Standard Edition (SE) 8, the
most recent version available.

CourseMate
The more you study, the better the results. Make the most of your study time by accessing
everything you need to succeed in one place. Read your textbook, take notes, review
flashcards, watch videos, and take practice quizzes online. CourseMate goes beyond the book
to deliver what you need! Learn more at www.cengage.com/coursemate.
The Java Programming CourseMate includes:
Debugging Exercises: Four error-filled programs accompany each chapter. By
debugging these programs, students can gain expertise in program logic in general and
the Java programming language in particular.
Video Lessons: Each chapter is accompanied by at least three video lessons that help to
explain important chapter concepts. These videos were created and narrated by the
author.
Interactive Study Aids: An interactive eBook, quizzes, flashcards, and more!
Instructors may add CourseMate to the textbook package, or students may purchase
CourseMate directly at www.CengageBrain.com.

Instructor Resources
The following teaching tools are available for download at our Instructor Companion Site.
Simply search for this text at sso.cengage.com. An instructor login is required.
Electronic Instructor’s Manual: The Instructor’s Manual that accompanies this
textbook contains additional instructional material to assist in class preparation,
including items such as Overviews, Chapter Objectives, Teaching Tips, Quick
Quizzes, Class Discussion Topics, Additional Projects, Additional Resources, and Key
Terms. A sample syllabus is also available. Additional exercises in the Instructor’s
Manual include:
Tough Questions: Two or more fairly difficult questions that an applicant
might encounter in a technical job interview accompany each chapter. These
questions are often open-ended; some involve coding and others might involve
research.

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Acknowledgments

Up for Discussion: A few thought-provoking questions concerning programming in


general or Java in particular supplement each chapter. The questions can be used to
start classroom or online discussions, or to develop and encourage research, writing,
and language skills.
Programming Exercises and Solutions: Each chapter is accompanied by several
xxv
programming exercises to supplement those offered in the text. Instructors can use
these exercises as additional or alternate assignments, or as the basis for lectures.
Test Bank: Cengage Learning Testing Powered by Cognero is a flexible, online system
that allows you to:
Author, edit, and manage test bank content from multiple Cengage Learning
solutions.
Create multiple test versions in an instant.
Deliver tests from your LMS, your classroom, or anywhere you want.
PowerPoint Presentations: This text provides PowerPoint slides to accompany each
chapter. Slides may be used to guide classroom presentations, to make available to
students for chapter review, or to print as classroom handouts. Files are provided for every
figure in the text. Instructors may use the files to customize PowerPoint slides, illustrate
quizzes, or create handouts.
Solutions: Solutions to “You Do It” exercises and all end-of-chapter exercises are
available. Annotated solutions are provided for some of the multiple-choice Review
Questions. For example, if students are likely to debate answer choices or not understand
the choice deemed to be the correct one, a rationale is provided.

Acknowledgments
I would like to thank all of the people who helped to make this book a reality, including Dan
Seiter, Development Editor; Alyssa Pratt, Senior Content Developer; Carmel Isaac, Content
Project Manager; and Chris Scriver and Danielle Shaw, quality assurance testers. I am lucky to
work with these professionals who are dedicated to producing high-quality instructional
materials.
I am also grateful to the reviewers who provided comments and encouragement during this
book’s development, including Bernice Cunningham, Wayne County Community College
District; Bev Eckel, Iowa Western Community College; John Russo, Wentworth Institute of
Technology; Leslie Spivey, Edison Community College; and Angeline Surber, Mesa
Community College.
Thanks, too, to my husband, Geoff, for his constant support and encouragement. Finally, this
book is dedicated to the newest Farrell, coming March 2015. As this book goes to production,
I don’t know your name or even your gender, but I do know that I love you.
Joyce Farrell

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Read This Before
xxvi
You Begin
The following information will help you as you prepare to use this textbook.

To the User of the Data Files


To complete the steps and projects in this book, you need data files that have been created
specifically for this book. Your instructor will provide the data files to you. You also can
obtain the files electronically from www.CengageBrain.com. Find the ISBN of your title on the
back cover of your book, then enter the ISBN in the search box at the top of the Cengage
Brain home page. You can find the data files on the product page that opens. Note that
you can use a computer in your school lab or your own computer to complete the exercises
in this book.

Using Your Own Computer


To use your own computer to complete the steps and exercises, you need the following:
Software: Java SE 8, available from www.oracle.com/technetwork/java/index.html. Although
almost all of the examples in this book will work with earlier versions of Java, this book was
created using Java 8. The book clearly points out the few cases when an example is based on
Java 7 and will not work with earlier versions of Java. You also need a text editor, such as
Notepad. A few exercises ask you to use a browser for research.
Hardware: If you are using Windows 8, the Java Web site suggests at least 128 MB of
memory and at least 181 MB of disk space. For other operating system requirements, see
http://java.com/en/download/help.

Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Features
This text focuses on helping students become better programmers and understand
Java program development through a variety of key features. In addition to Chapter
Objectives, Summaries, and Key Terms, these useful features will help students
regardless of their learning styles. xxvii

YOU DO IT sections walk


students through program
development step by step.

NOTES provide
additional information—
for example, another
location in the book that
expands on a topic, or a
common error to watch
out for.

The author does an awesome


job: the examples, problems,
VIDEO LESSONS help
and material are very easy to
explain important chapter
understand!
concepts. Videos are part
—Bernice Cunningham, of the text’s enhanced
Wayne County Community
CourseMate site.
College District
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Exploring the Variety of Random
Documents with Different Content
(28.29). The conquest of JERUSALEM [y.v. , § 13^!] was the neces
sary preliminary of this. Being taken by David himself from the
Jebusites, it formed originally no part of the tribe of Judah ; but its
possession secured the continuance of the family of David on the
throne of Judah, and in Josh. 1563 (RJE) it is represented as half-
Judahite, half-Jebusite. On Solomon's supposed exclusion of Judah
from the departmental division of his kingdom see SOLOMON,
TAXATION, and cp Kittel on i K. 4g/. The tribe of Judah is referred to
twice in the NT (Heb. 7 14 Rev. 7s); but the references require no
comment. The isolation of Judah is its most notable geographical 1
Note that Timnah (v. 12) is mentioned in Josh. 1655-57 'n the same
group with Maon, Carmel, and Ziph (which name underlies ' Chezib '
in Gen. 38 5). 2 He was probably ' prince of Abihail ' (i S. 263, crit.
emend.). See NABAL. 3 The supposed reference to David as ' head
of Caleb ' after he had removed to Hebron can hardly be maintained
(see NABAL). Tradition rightly describes him as a tneUk ('king,' '
chieftain '). 4 This may be implied too in the story of PEREZ-UZZAH
and OBED-EDOM the ' Gittite ' (Rehobothite) in 2 S. 6. Perhaps too
the ' Rabbath-bne-Ammon' of 28.1226^ should rather be '
Rehoboth-bne-Jerahmeel ' (cp REHOBOTH, and see Crit. Bib.). 6 In
this connection it may be noted that in the earlier and much briefer
story on which i S. 17 is probably based, ' Goliath of Gath' was
probably 'Goliath of Rehoboth,' 'the valley of Elah ' (nSxri) was 'the
valley of Jerahmeel,' and ' Bethlehemjudah ' was ' Bethel-judah.'
2620
The text on this page is estimated to be only 7.98%
accurate

v. II ci U ja SB < j •^ M U X iii aa U PI uffl u I a D « U _£ p


* U J5 V /. • c i ^ -•2 £3 (THE DEAI H Q a r^ ro «Q Q _' M C) M u M
r< isst'^^NN ^ i •£ •«^ •^ ^ "a" . N u 9 U < ? -^s K D x "•? $ /S?
""" S 11 *z /a> *$ t ^ « S < 6 3 x" c tri < is N S^° 3 CO i< ci C3^^
n SCMM^J'S ^ ^Xg «^ U^^« «< K 2-5 j| > M ^O —.ics" N HQQ^£
N^Sc. Q43- -| =3 g-S''0 Q "" ^-co ^ ffl « „ " ^,5"^ w | H g iS- | ,s "
| Q u S N Q 1 ^ — '^ a &3 ^ --g Q 'v a -13 ^ i2 '^43 ^" ,£J '-1 "3T
5 ^ - — uT >, P "S 5 rf ~-|— • C 43 Q '3° -" -C-^ rt JJ _- . ™^; ^i, -
^ .h •— -^3 "^ S S'Z rt w Q . ~~fQi> < *l s ^ • "§ '5 ^ irt t^ •- J
"u s tills Sid a J J 3 £ 15 S v £.* "3 •§ u >,£ *3 S j ^ t^^< § £ >//r'
^g fcfl |3 »Tj >, 0 0 ^ 0) Jg. 'rt'32 — ^2 rt rt o S 3 B a* s s 1 K x K
;s cd i >~, • S II-H T3 -O Sl-sll W ^^ D !? K s ° ^ '? ^ *^3 JM
^i^< lS3' r^ 3 QQp rN, gn 1 SQ -•; HNfeS, *.c-U5(-i^^^p, ^ r^^)S
H ^ w 9 irc-C- ^— ' _• r i ?M.Si?*3*ff p!!l0»i!s|=:dti ^ UJ A^.^ «
fcv! w . ies^ U 3. N UU. CM •~* - ;— ' | 1 c --g c — a S rf m O J3 3
C ^ ^ ^M.3 £ ace £ K ^r § Q p ^-l-lll U -5 ^" -rll 0 Q a d »- •§
M_TO£ f*- brt,^1^ ** ^ O g w w i IDICU A >3 -jn-ii §sr^ iiilttliii fi
^wawwa ^^.rt'g^ oooo??^ooo xK i^t 1 7 •» i t ^ -i,^--H D *^* 5
~. ^ ^ x-v H "•a ~-'i« a.||a?|* S ^ J ?: It P N a « -> ^ .S -~ M S" -
f" < — W -7~ N /-\ " 01 CM ^ s3 -— ^ § i jj.f.^^^ Q ^J « < S o,
^^f ^"Q . p, -p^QQ Q .** . j^ s si N < ||«-«,|2|ll<3.'S 5 ^ S jj p* *
C 'O ^ J!
The text on this page is estimated to be only 14.67%
accurate

JUDAH AND JUDAEA. w < Q


The text on this page is estimated to be only 26.95%
accurate

JUDAH characteristic. Its boundaries are given in Josh. 15


1-12 6' '• The N. boundary coincides with the S. boundary of
Benjamin ; only it is given with greater fulness. On the E. the
boundary is the Dead Sea ; on the W. the Mediterranean ; on the S.
a line drawn from the southern tongue of the Dead Sea to the Nahal
Misraim (rather Misrim ; see EGYPT, BROOK OF), and passing by the
ascent of Akrabbim, Zin, Kadesh-barnea, and other places (consult
HAZARADDAR, HEZRON, KARKAA). The idealizing tendency of P
comes out in his inclusion of Philistia within Judahite territory. There
is an inconsistency with regard to Kirjath-jearim, which Judg. 18 12
and Josh. 15 60 make Judahite, whilst Josh 18 28 apparently assigns
it to Benjamin (cp KIRJATH-JEARIM) ; also with regard to
JERUSALEM [q.v., § 13]. It should be noticed that in the earlier
narratives we hear of LEHI (Judg. 15 9) and ADULLAM (i 8.22$, see
above), or rather Carmel, as . belonging to Judah ; we also read of a
Negeb of Judah (i S. 27io; see NKGEB). The natural divisions of the
territory are — the NEGEB, the SHEPHELAH, and the Wilderness of
Judah (see DESERT, § 2 [3] and § 3 [3]). It is urgently necessary to
get a clear idea of each of these without which the full significance
of many OT passages will be missed. As to the names in Josh. 15
20-62 reference must also be made to special articles. Some
progress has doubtless been made in settling the readings (which in
MT are often incorrect), and consequently many current
identifications have not improbably been criticised in the present
work with effect ; but much uncertainty still attaches to many of the
details (see e.g. the names of places on the S. boundary). Judah is
not to be blamed for indifference to the great struggle celebrated in
Judg. 5 ; a tribe of Judah _ . . did not at that time exist. In Dt. 887
(in ' the ' Blessing of Moses '), however, we meet with a prayer that
Yahwe would bring Judah ' to his people,' — i.e., that the great
schism might be healed, and Judah reincorporated into the people of
Israel ; it is the saying of a N. Israelite. The ' Blessing of Jacob '
(Gen. 49 9 ii1) celebrates the fierceness and victorious might of
Judah and at the same time its appreciation of the natural
advantages of its land (Judah was a vine-country; cp Joel \T ff., 3 [4]
18 2 Ch. 26 10, and HEBRON, § 3). Later history exhibits this tribe
as tenacious, conservative, and even fanatical — character istics
perhaps not wholly unconnected with its Edomitish and N. Arabian
affinities. The two ' Blessings ' just referred to are the only pre-exilic
poetical passages in which the name Yghudah occurs ; even in the
exilic and postexilic poetry it is very rare. Among the 8. Use of
prophets it is Jeremiah who uses the term most frequently, though
the abundance of interpolations in his book makes it difficult to
estimate the exact numbers. The examination of the historical books
leads to some interesting results. The phrase bne Yehudah occurs in
Judg. 18/ 16 2 S. 1 18 21 2 i Ch. 12s6 2Ch. 10i7 25i2 28 10 316
Neh. 11425 13i6 Dan. 16; also in Jer. 730 823032 [L. 433],
Joel3[4]68i9 Ob. 12. But some of these occurrences are of small
account, being due to glosses, and 2 S. 1 18 is strongly corrupt (see
JASHER, BOOK OF, § 2). The phrase beth Yehudah is not much
commoner. Yehudah is, of course, frequent. According to Staerk,2 it
may be inferred from the use of ' Israel and Judah ' in passages like
2 S. 3 10 11 ii and i K. 232 that there was a sense of the inner
opposition between north and south before the separation of the
kingdoms. The above article on a subject of great difficulty sums up
some of the chief results of special articles. The reader will, of 1 On
v. 10, which seems to interrupt the connection, see SHII.OH. 2
Studien zur Relig. u. Sprachgesch, des AltenTcst. ('99), 90. 2621
JUDAH, HILL-COUNTRY OP course, consult the histories of Israel,
not forgetting the most recent — that of Winckler, to some of whose
conclusions the above article gives an independent support. 2. b.
Senuah, Neh. 11 9, doubtless the same as HODAVIAH, 2 3. A
Levitical family, according to the MT of Ezra 3 9 = i Esd. 5 58 (JODA,
iiaSa [A]). Here, as in Neh. l'2s(uaSae [«*A]), some would read
HODAVIAH \q.i>., no. 4] ; possibly, however, the original name was
%11")n (2 Sam. 2825, HARODITE). See GENEALOGIES i., § 7 [i]. 4.
A Levite (the above clan individualised?), Ezra 1023 (1060^1 [B],
teSoju. [NAL])=i Esd. 9 23 (JuDAS, o>oi/6as [BA]). 5. A priest's son,
Neh. 12 36 (om. BNA). T. K. C. JUDAH, HILL-COUNTRY OF (PHI IT
in;fy>oj Ioi;5a), RV Josh. 11 21 20 7 21 n 2 Ch. 274, and virtu ally
Josh. 1548 18 12 Judg. Igig Jer. 3244 8813, or, OF JUDAEA (Lk. 1
65, rj dpeivr) rrjs 'lovdaias), is the special term for a well-defined
region to the north of what was called the NEGEB [g.v.], some 25
miles long by 12 to 17 broad, and from 2000 to 3000 feet above the
sea. Under the title of Orine it forms the ninth of Pliny's Judaean
toparchies. l It has for its centre the ancient city of HEBRON,
between which and the Negeb there is a fertile plateau, 9 miles by
3, which forms a strong and agreeable contrast to the Judcean table
land in the north. It is of this table -land that travellers think when
they speak of Judaea as a stony desolate region. Apart from some
breaks in the plateau, which enjoy a rich vegetation, such as
Bethany, the Valley of Hinnom, 'Ain Karim, the Wady Artas (see
CONDUITS, § 3), the valleys near Bethlehem, and especially Hebron,
the thinly covered limestone pro duces a very dreary effect ; one
cannot help pitying the few dwarf trees which wage a doubtful
struggle for exist ence with the boulders around them. Nevertheless
the austerity of this region was not always nearly so unmitigated ; it
did but call out the art and energy of man to counteract it. By a
trained historic imagination we can recall some of the vanished glory,
the traces of which, indeed, are multitudinous. One may wander for
many miles in perfect solitude in a country of sheep and goats. But
the hills are crowned with ruins, and the sides of the hills are
terraced, and by the fountains are fragments of walls and heaps of
stones which indicate the ancient homes of men. The greatest
elevation in the hill-country of Judah is attained by the Si ret el-bella
a (3370 ft.), which ter minates a mountain-ridge between Halhul and
Hebron. The chief valleys are the Wady Halil, which is joined by the
valley of Hebron, and beginning NE. of Hebron, runs first southward,
then south-westward, and finally unites with the Wady el-Milh
(coming from the east), forming the Wady es-Seba. WNW. from
Hebron begins the Wady el-Afranj, which runs NW. to join the Wady
es-Sant at Ashdod. This is probably the 'valley (ira) northward from
Mareshah' (2 Ch. 14 10 ; see ZEPHATHAH) where Asa is said to have
defeated the ' Cushite ' invaders. Farther south is the broad and
fruitful Wady es-Sur, which first of all runs north, then turns
westward, and under the name of the Wady es-Sant (see ELAH,
VALLEY OF) cuts through the Shephelah. At Shuwekeh (Socoh) is
the point of junction of the Wady es-Sur and the Wady en-NajIl. This
and other wadies issue in a remarkable basin about 30 miles long,
which divides the mountains of Judah from the lower hills of the
Shephelah. Towards the NW. this basin is drained by the broad and
fertile Wady Sarar, which near the coast assumes the name Nahr
Rubin (see JABNEEL). Not far from Tekoa is the great Wady 'Arrub,
where is the ruin called Bereikut, in the name of which some find an
echo of the Berachah of i Ch. 2026 (see BERACHAH, VALLEY OF).
The Hebrew text of Josh. 1048-60 reckons as belonging to this
region thirty-eight cities, some of which can be identified with
obvious certainty, such as Eshtemoh, Beth - Tappuah, Hebron, Maon,
Carmel, Ziph, Juttah, Zanoah, Halhul, Beth1 7W/9i5; in the list of
Jos. (/?/ iii. 85), En-gaddi is the corresponding name. Schick (ZDPV
22 83 ['99]) ventures to suppose a confusion between En-gedi and
'Ain Karim. 2622
The text on this page is estimated to be only 24.87%
accurate

JUDAH, KINGDOM OF zur. There are also, however, places


which are omitted in MT, but have an undeniable claim to be
included in the list ; and (5 ; in Mk. 3 19 Lk. 6 16 J n. 6 7
CTKapuuO). Thrice in the Fourth Gospel (Jn. 671 182 26)
Judas is , „ called the son of Simon, which may well be 1.
Name. ,- • a genuine tradition. 1 Also iia&as i Mace. 13s [A],
and IOUAOS i Mace. 4 13 [A], the latter a corruption in the
Gk. 2623 JUDAS As for the name ' Iscariot ' (twice applied to
the father of Judas, Jn. 671 1325), there is a well-supported
reading in Jn., os), and calls to him whom he himself would,
and they went unto him ' (Mk. 813) ; the oOj tf0e\ei> avrbs
assures us that every one of the persons named was
specially chosen by Jesus. Twelve are named ; three lists of
the twelve are given, and in each of the three Judas stands
last (Mt. 104 Mk. 819 Lk. 616; see APOSTLE, § i). Mt. and
Mk. add, ' who also betrayed him ' ; Lk. adds, ' who became
traitor' (5s eyevero irpodar^). In the lists of Mt. and of Mk.
the eleventh, and in that of Lk. the tenth, is Simon called 6
Kavavalos or ffyXwnjj. Farrar has offered the conjecture
that this Simon was the father of Judas Iscariot, and it is
certain that in Jn. (see § i) Judas Iscariot is called the son of
Simon. It is not likely, however, that both father and son
would belong to the Twelve, and Simon was a very common
name, whilst Kavavaios is very possibly a corruption of
Kavaios ('a man of Cana'), which would make this Simon a
Galilaean. All that we can say is that Simon and Judas were
probably companions whenever the Twelve were sent out '
by two and two ' (Mk. 67). There is no list of the Twelve in
the Fourth Gospel. In Jn. 671, however, we receive early
notice that Judas . _ Iscariot was one of the Twelve, and 3.
Notice in jn. that k was he who was destined to deliver up
Jesus (Jn. 671). The notice (o5ros yap ejieAAev atiTOf
irapaoiSovai, els wv « T. 70 appears to be inconsistent with
the equal confidence in all the disciples shown by Jesus
according to the Synoptic tradition — a confidence which is
maintained unbroken till the last paschal meal. The Fourth
Evangelist further tells us (Jn. 124-6) that the destined
traitor murmured at Mary's costly gift of love at Bethany,
when she took a pound of SPIKENARD [y.f.] and anointed
the feet of Jesus ; he also mentions as the secret cause of
this murmuring of Judas that he ' was a thief, and having
the box took away what was put therein.' So at least the
traditional text must be interpreted (on KXe'nrnjs r\v KO\
TO y\u> AIIX> a P"re'y literary correction, cp Jn. 13 29. The
conjecture of Peerlkamp (?) and Bakhuizen, e\ov, is not
satisfactory. 2624
The text on this page is estimated to be only 26.63%
accurate

JUDAS account for the smallness of the sum which (Mt. at


least says) tempted Judas to betray his master. It would seem that
here there is a clear case of corruption, and that a very early editor
of the text may have miscorrected the corrupt passage before him.
Very possibly we should read, on xa^€7!'8 Mk. 14 4. 2 Weiss (Leben
Jesu, 2 443) cannot account for the imputation of thievish intentions
to Judas in Jn. except on the theory that the apostle John had found
out thefts committed by the greedy Judas, and Godet speaks of
some one who has accused John of a personal hatred to Judas. The
difficulties disappear if the reading proposed above is accepted.
According to Mt. 26 14-16 Mk. 14io /. , after the anointing in
Bethany ' one of the twelve called Judas _,. Iscariot' (Mt. ; nearly so
Mk. ) went to the _ ' . chief priests and offered to betray Jesus to ^ '
them. On receiving their promise of 'money' (dpyvpiov, Mk. ) or
'thirty pieces of silver [shekels] ' (rpidKovra. dpyvpia, Mt. ), Judas
sought for an opportunity to betray him. Lk. (22 3-6) altogether
disconnects the transaction from the scene of the anointing. After
noticing that every night Jesus camped out (ijflMfeTo) on the Mount
of Olives (2137), which prepares the way for the notable statement
in 2239, Lk. mentions that the passover was drawing near, and that
the chief priests and scribes were seeking for a way to effect the
destruction of Jesus. Then ' Satan entered into Judas, called Iscariot,
of the number of the twelve' ; the rest of the notice agrees with that
of Mt. and Mk. Evidently the assumption that Satan had entered into
Judas is a humane one : treason against the Holy One was too foul a
crime for a disciple in his right mind to have committed. It should
also be noticed that all the Synoptists (Mt. 1722 Mk. 931 Lk. 944)
mention that after Peter's confession of Jesus' Messiahship, Jesus
spoke of his being ' delivered up into the hands of men.' Mt. says
that the disciples were 'very sorry ' ; Mk. and Lk. that they '
understood not the saying.' We should never have guessed (nor did
the apostles guess) that one of them was capable of com mitting
treason. Quite a different account is given in Jn. (18218 21-30).
Nothing is said of the visit of Judas to the chief priests _ Accoun4.
ar)d of the promised payment of his ., treason, nor of his deliberate
search for an opportunity to betray Jesus. It was at the Last Supper
that the hateful idea occurred to Judas, and it was inspired by the
devil (18227). Jesus openly declared (w. 1018) that one of his
chosen ones would ' lift up his heel ' against him, to fulfil the old
scripture (Ps. 41 9). Yet he gave one more special proof of love to
the traitor, and it was after this that Satan took full possession of his
captive. ' Therefore Jesus says to him, That thou doest, do quickly ' ;
Judas went out, ' and it was night. ' It is a modification of the
Synoptic tradition that we have here, though Lk. has already
suggested it by his reference to Satan. It was not to any common
temptation that at last Judas fell victim ; he was taken by storm.
How, according to Jn. , the original suggestion of treason (Jn. 182)
was made plausible, there is no direct evidence to show. From Jn.
660-65, however, we infer that, according to the evangelist, Judas
was one of those who entertained unspiritual views of Messiahship.
When the last hope 1 Both icAejrTTjs and icou yAwcrcro are based
upon a miswritten XoAeiros ; KO/JLOI' and ex&n' have come out of
KOIVOV, and /3oA\0fifva out of /SoAAaiTioi'. •yAu><7e Judas before
this solemn evening, but has made no change in his demeanour
towards him. Now, however, he announces the fact, ' One of you will
betray me, even he that eats with me. ' ' Is it I ? ' asks each man
sorrowfully. ' It is one of the twelve, he that dips with me in the dish
. . . Good were it for that man if he had not been born' (Mk. 14i7-2i;
cp Mt. 2620-24 Lk. 2221-23). The accounts do not entirely agree. It
is only Mt. who expressly states that Judas the traitor also put the
question, ' Is it I ? ' — and the way in which the statement is
introduced suggests that it is an addition to the earlier story (Mt.
2625). Jn. , as we have seen, diverges most widely from the simple
form of the Synoptic narrative. The account of the betrayal itself also
is very variously given. All the Gospels agree that it was by an armed
. . band that Jesus was arrested, and that '. , Judas was its guide.
Both the scene of the arrest, however, and the circumstances are
different in the Synoptic Gospels and in Jn. respectively, and it is for
our present purpose especially noteworthy that nothing is said in Jn.
of the kiss with which according to the Synoptists Judas ventured to
greet Jesus. Mk. and Lk. give the simplest narrative ; Mt. (2650)
makes Jesus answer the traitor with 'Ercupe, i 6 •jrdpei, 'Amice, ad
quod venisti ' (Vg. ), an untranslat able phrase, while Lk. gives, '
Judas, betrayest thou the Son of Man with a kiss,' suggesting what is
prob ably the true reading in Mt. , viroKpivei, 'Thou feignest,' 'Thou
actest a part,' 'Thou art no friend of mine.'2 To Jn. the outward
details of the act of Satanic treachery are indifferent. The end of the
traitor is told in Mt. 27 3-10 Acts 1 18-20. The discrepancies
between the two accounts are remark_ , , able, and the silence of
Mk. and Jn. is also ' e^ noteworthy. Mt. states that Judas, on 0 U as.
tnat jesus %vas condemned, was struck with remorse, and brought
back the thirty shekels to the chief priests, confessing that he had '
betrayed innocent blood.' Then he hurled the 'pieces of silver into
the sanctuary (ei's rbv vaov), and departed ' ; tc this is added a
further statement, complete in itself, ' and he went away and
hanged himself (a.Trriy^a.To) — where, we are not told. The chief
priests, however, with characteristic scrupulosity, would not put the
money into the sacred treasury (Kopf3avas), but bought with it the
potter's field to bury strangers in. This field 1 Commentary on St.
John ('87), 3 121. 2 Hpltzmann's criticism that Lk.'s form of the
speech of Jesus is rhetorical, does not go to the heart of the matter.
The form may be rhetorical ; but the idea is appropriate to the
occasion. ' Friend, (do) that for which thou art come,' RV's rendering
of e' o jropet, is most unnatural ; Judas had done his work ; the
underlings of the chief priests had to do the rest. Vet most moderns
agree with RV, and if anything had preceded which made such an
aposiopesis natural (e.g. ,'and Judas said, "What shall I do?'"), it
would be right to follow RV. AV's rendering, ' Friend, wherefore art
thou come,' is much more natural, but it is ungrammatical. There
must be an error in the text. Eroupe (an unsuitable word, whether
we render ' Comrade ' or ' Good Friend ') should come after «j> o
irapei (so D a c f Syr *ch L c i f)- It is a corruption of a dittogiaphed
o naptt, D in fact gives erepai. E
The text on this page is estimated to be only 26.61%
accurate

JUDAS received the name, ' Field of blood,' and so a


prophecy of Jeremiah (or rather Zechariah) was fulfilled.1 Here we
have Iscariot represented as a second Ahithophel, who, so far as
intention went, betrayed David to his enemy, and hanged himself (2
S. 1723). The account in Acts can be separated, with advantage to
the sense, from the speech of Peter in which it occurs, and may
perhaps be a later insertion. It is, however, at any rate of early date.
It states that, so far from restoring the money, Judas ' acquired a
field (xupiov, see FIELD, 9) with his unrighteous reward ; and falling
headlong (on the field)2 he burst asunder in the midst, and all his
bowels gushed out.' Hence that field was called Akeldama, or 'The
field of blood' (see ACELDAMA). So, it is added, the prophecies in Ps.
6925 and 1098 were fulfilled. Clearly here is a mere popular
explanation of ' Akeldama, ' and not less evidently here is the
expression of the popular sense of justice as regards the end of the
traitor. A more elaborate and tasteless story is given by Papias
(Fragm. III.); it seems to be an independent version of the popular
legend, reminding us partly of Acts 1 18, partly of the legend of the
end of Antiochus Epiphanes in 2 Mace. 9$ff. Returning to the two
biblical accounts, we note that De Quincey ( Works, 6 21-25)
endeavours to remove the discrepancies, but by purely arbitrary
means. This is quite needless. Both the modes of death assigned to
Judas were conventionally assigned to traitors and enemies of God,
and more especially that given in Acts 3 to which there is a striking
parallel in the story of the death of the traitor Nadan in the tale of
Ahikar. Mr. Rendel Harris suggests that the original reading in Acts 1
18 may have been, not Trprjvr]s yevofj.evos, but irprio'6eis, ' having
swollen out ' ; the existing reading he accounts for by a tradition
which identified Judas with a poisonous serpent, and he illustrates
by ' upon thy belly shall thou go' in Gen. 3 14. See 'Did Judas
commit suicide?' Arner. /. of Theol., July 1900. The psychological
attempts to explain the character of Judas so as to comprehend the
crime ascribed to him 9 Character are numerous- His despair has
been regarded as a proof of original nobility of character (Hase) ; he
has even been regarded as having sought the attainment of a good
object by evil means (Paulus). Neander too was touched by the
same generous anxiety for the misguided apostle. ' If Jesus is the
Messiah,' so he considers Judas to have reasoned, ' it will not injure
him to deliver him up to his enemies, for legions of angels will come
to his rescue, while if he is not the Messiah, he deserves
destruction.' Thus the betrayal was merely a test, intended to clear
up all doubt. Volkmar thinks that ' in the heart of the zealot who
hoped to draw Jesus to battle and to victory, the greeting, so fearful
to us, " Hail, Master," must have meant, " I greet thee, O king of
Israel : now show thy power"' (Jesus Nazarenus ['82], 121). De
Quincey considers that the object of Judas was — 'audacious in a
high degree, but for that very reason not treacherous at all. His hope
was that, when at length actually arrested by the Jewish authorities,
Christ would no longer vacillate ; he would be forced into giving the
signal to the populace of Jerusalem, who would then rise
unanimously, for the double purpose of placing Christ at the head of
an insur rectionary movement, and of throwing off the Roman
yoke.1 All these theories are entirely contrary to the evangelic
narratives. If we accept the tradition that Judas betrayed his Master,
we cannot separate it from the statement that he did it either out of
Satanic wickedness or for money. Are critical students, then, really
bound to accept the tradition as historical? 1 The passage, Mt. 27
o/., which shows evidence of Christian modification, has probably
come from a collection of Messianic passages of the OT prophets in
use among the Christians. (This also accounts for Sia TUIV irpo^riav,
Mt. 223 ; cp NAZA RETH.) On Zech. 11 izf., see GASm. Twelve
Prophets, 2 475, and cp POTTER. 2 But cp J. R. Harris (below).
Papias : ei> ISita aa-l XWP'V TeAeimjaai/Ta. 3 Cp Zeller, Die
Apostelgeschichte, 81. 2627 JUDAS ' The fact of the treason of
Judas is so unexpected, so incredible, so terrible ; it jeopardises so
painfully our faith not only in human fidelity but also in the dignity
10. The story and greatness of Jesus, in his knowledge, of JlldaS. his
judgment, his keenness of vision, and above all, the weight of his
influence and of that love of his which could melt even ice, and it is
such a mark for the scoffing of enemies, beginning with the
venomous CeUus,! that we should have to greet it as the removal of
a hundred pound weight from the heart of Christendom, if the
treason of Judas could be proved to have had no existence.'2 The
growth of the story of Judas can also be ade quately explained.
Supposing that the original tradi tion left the ease with which the
capture of Jesus was effected unaccounted for, Christian ingenuity
would exert itself to find an explanation. Passages in the Psalms
which spoke of the Righteous Man as treated with brutal insolence
by his own familiar friend (Ps. 41 9 5612-14) would suggest the
originator of the outrage; the betrayer of Jesus must have been a
faithless friend. And if an apostle, who could he have been but Judas
Iscariot? For Iscariot was not a Galilean like the other apostles ; he
had a harsh, crabbed temper (xaXeT^s), and he carried the purse of
the little company. The last circumstance suggested a reminiscence
of Zech. 11 12 /. — a mysterious passage which seemed to become
intelligible for the first time if applied to Jesus. This view is not
altogether new ; in its earlier forms it has found little favour,3 but it
may nevertheless in essentials be true. The objections to it are (i)
that the story of Judas's treason has fixed itself firmly in our oldest
documents, and (2) that in Acts 1 we have an account of the
appointment of Matthias to the vacant apostleship. It cannot,
however, be proved that Judas's treason formed part of the oldest
tradition ; it is separ able from the surest traditions of the life of
Jesus, and the appointment of Matthias may perfectly well have
taken place, even if Judas did not betray Jesus. The probability is
that no one knew how the emissaries of the Pharisees found Jesus
so easily, and that the story of Judas's treason was a very early
attempt to imagine an explanation. Probably Judas did dis appear
from view. We know that all the disciples ' forsook Jesus and fled'
(Mt. 2656 Mk,145o); Judas probably returned to his home, and
never again joined the Galilean disciples, with whom he may have
felt little sympathy. This view has the advantage over that still
prevalent, because it does not force us to think that Jesus treated
Judas worse than Peter, for whom he prayed when Satan ' had
obtained him by asking, in order to sift him as wheat' (Lk. 2231), or
that the prayer Trpocrfles T]\iiv vCa-Tiv (Lk. 17 5) was unanswered
in the case of Judas. That popular mythology gladly releases the
traitor Judas from hell once in the year (cp Matthew Arnold, Saint
Brandan), should perhaps stir the critical conscience to examine
more fully into the grounds of the received opinion. A wild Gnostic
fancy may be mentioned, as a singular specimen of early
speculations about Judas. Epiphan. 38 3. Some Cainites say that
Judas delivered up Jesus because he regarded him as a wicked man
(ironjpop), who meant to destroy the good law. Others say that he
gave Jesus up just because he was a good man. The rulers knew
that if Jesus were crucified, their ineffectual power would be brought
to nought. Judas therefore made a mighty effort to deliver him up
for the salvation of mankind, and deserves praise as an ' agent ' in
the events which have led to our salvation and enlightenment
(dAAoc. Se ra.cr\v, aAAa ayaOov avrbv ovra Trapf&iaxe Kara TTJV
fwovpaviov •yi'uxrir. eyi'taaav yap, r)(rtv, oi apxavrei;, OTI, eav 6
xptcrrbs na.pa.So9r) oraupw, KevovTa.i avTa>i>i7 atrdci'ris fiuyajuis,
icat TOVTO, T)tTi, yvovs o 'louSay, eoTreva* »cal TTO.VTO. e
The text on this page is estimated to be only 26.83%
accurate

JUDAS Sulpicius Quirinius, the governor of Syria, instituted


a census of the newly annexed district. In Gamaliel's speech in Acts
5 37 it is rightly stated that he ' rose up in the days of the enrolment
(diroypcKprj) ' — the only enrolment known to Lk. — which had
already been mentioned in the Third Gospel (2if. ; see QUIKINIUS).
Josephus speaks of Judas at some length in BJ ii. 81, Ant. .\\iii.li6,
and also makes brief reference to him in BJ \\. 178, vii. 8 1, Ant. xx.
02. The epithet (6 [xaAovju-efos] TaAiAaios or ai>r)p raAiAaio?)
which he bestows on him, expresses clearly that he was of Galitean
origin, and had received from this circum stance the standing
addition to his proper name (which was a very common one) ; it
would be given all the more readily if his first public appearance was
in Judaea, outside of his native land. Josephus (Ant. xviii.li) calls
him, more precisely, a man of Gaulanitis (r>i-n)s ai^jp), and says
that he came from Gamala. Gamala was in Gaulanitis not far from
the eastern shore of the Lake of Gennesareth, and Gaulanitis could
be reckoned as belonging to Galilee in the broader meaning of that
word. What Judas actually did is not quite clear from the account of
Josephus. According to BJ ii. 178 he merely reproached the Jews
with their subjection to the Romans ; according to BJ ii. 8 1 he
instigated them to revolt (els a.irt)aTa.(nv tvrjye) by his reproaches ;
according to BJ vii. 8 1 he persuaded ' not a few ' ( OVK 6\iyous) to
make no returns (/xr; troifiadai rets d.Troypa.(f>a.s) ; according to
Ant. xx. 62 he actually caused the people to revolt against the
Romans (. . . rov rbv \abv atrb "Pu^a-lav diroffr^fravTos). The
expression last quoted goes too far if we take as our basis the chief
passage in Josephus (Ant. xviii. 1 1). In that passage he introduces
his refer ence to Judas only after explaining how the Jews, yield ing
to the persuasions of Joazar the high priest, had submitted to the
census. Judas indeed, he says, was urgent for revolt (rj-jreiyeTo tirl
d.iroi\ocro^>iav), as he does also in the other leading passage (5/ii.
81), where he calls Judas a ' sophist of a sect of his own ' (O-
CK/HOTT/S Idias aipecrews ; cp ii. 1 7 8 ' a most cunning sophist , '
O-O^ICTTTJS SeivoTaTos ) ; in both places he takes occasion to
characterise the three previously existing ' philosophies ' oi the Jews
— those, namely, of the Sadducees, the Pharisees, and the Essenes
— but it is only in Ant. xviii. 16 that he goes into the ' philosophy ' of
Judas and his companions. There he says that in every other respect
the followers of Judas agree with the Pharisees, but they are dis
tinguished by an unquenchable love of liberty — holding God alone
to be ruler and lord — and by indifference to death. The party of the
ZEALOTS (D'wg, Aram. K'JN:,} ; see CANAN^AN) is intended, from
which party arose at a later date the Sicarii or ASSASSINS, who not
only did not shrink from violence and rebellion against their enemies,
but also did not scruple to exercise a reign of terror over their co-
religionists by secret assassination. It is certainly no mere
coincidence that one of their most determined leaders — he who
held the fortress of Masada even after Jerusalem had fallen, and
with all his companions com mitted suicide when no longer able to
keep the enemy at bay (73 A.D. ; see ISRAEL, § 109)— Eleazar, son
of Jairus, was a descendant of Judas of Galilee and a relation of his
son Manaim (=Menahem), a ringleader at the beginning of the revolt
in 66 A.D. who himself in turn fell a victim to the fanaticism of the
Zealots in the same year(/?/ ii. llsf., vii. 8 i ; cp ISRAEL, § 101). It
will be observed that in Josephus no word is found of what is stated
in Acts 637, that Judas perished and all, as many as obeyed him,
were scattered abroad. On the other hand, Josephus tells us (Ant.
xx. 62) that the sons of Judas (i.e. , two of them), Jacob and Simon,
were put to death by the procurator Alexander of Judsea (there fore
about 46-48). In Lk. there is another noticeable 2629 JUDB
(EPISTLE) circumstance, the fact, namely, that Judas, notwith
standing the express mention of the census of 6-7 A. D. , is
nevertheless represented as coming upon the scene after Theudas,
whose insurrection was under the procuratorship of Cuspius Fadus
(i.e. , about 44-46). At the same time it has to be remarked that, as
the mention of the census shows, Lk. was not in error about the
period of Judas so much as about that of Theudas ; whether this
error justifies the conjecture that Lk. was acquainted with Josephus
will be con sidered therefore under the latter name (see THEUDAS).
The other conjecture, that Lk. confused Judas, so far as his end was
concerned, with his two sons, is certainly forcibly suggested by the
fact that his fate is mentioned after that of Theudas. Krenkel
(Josephus u. Lucas, '94, 168-170) has pointed out an analogous
case ; in i S. 17 Goliath is represented as having been slain by David,
but in the older account (2 S. 21 15-22) this feat is given to Elhanan,
while it is another giant that is encountered by David (cp ELHANAN,
GOLIATH). He instances similar slips of memory in Livy (xxi. 46g/. ),
in Cicero (Cato Major, 23, § 83), and in Josephus him self; Josephus
(Bf \\.1\j], among the four men who were sent to Jerusalem to stir
up the people against himself, names Judas the son of Jonathes,
whereas in Vit. § 39 he names Jonathes himself, thus (after an
interval of 25 years, it is true) making a mistake as to the name of a
person with whom he had been personally in strenuous conflict.
Krenkel himself adds, however, that even without confounding Judas
with his sons, it was not unnatural that Lk. should assign to him the
fate which, practically speaking, befell all the leaders of insurrection
in those days. In any case Lk. found no warrant in Josephus for his
statement that all the followers of Judas were scattered abroad.
Schiirer, GJVC^i \^o6f. (ET, Div. i. vol. ii. p. 81), confidently identifies
Judas of Galilee with the Judas, son of Ezekias, who after the death
of Herod the Great in 4 B.C. gathered a follow ing in the
neighbourhood of Sepphoris and rendered all Galilee insecure,
aiming, indeed, it would seem, even at the crown itself (BJ ii. 4 i,
Ant. xvii. 10s). Krenkel, however (p. 163), rightly doubts this
identification, inasmuch as Josephus does not give to this Judas the
epithet of Galilean, but designates him simply as son of Ezekias, and
moreover expressly records the execution of this robber-chief
Ezekias by Herod the Great. 11. Judas called Barsabbas (Acts 1622).
See BARSABAS, 2. 12. Of Damascus, with whom Saul stayed in the
'Street which is called Straight ' (see DAMASCUS, § 3), Acts 9 ii. P.
W. S. JUDE, THE GENERAL EPISTLE OF. The author designates
himself as Judas ' a servant of Jesus Christ, 1 Ge eral an
The text on this page is estimated to be only 25.39%
accurate

JUDE (EPISTLE) lively concern about certain ungodly men


(d(re/3eis, v. 4) 2 Occasion %vh° hac* ' sto'en m' (ira-pewtdvaav),
and who were ' turning the grace of our God into lasciviousness, and
denying the only Ruler and our Lord, Jesus Christ. ' He regards their
influence both in doctrine and in practice as a menace to the well-
being of the church, and he not only sounds a note of warning
against them, but also points out the punishment re served for such
as they. Not only did they deny Christ and God as the only Ruler
(TOV ii6vov SecrTTOTTjr) and thus act the part of ' liars ' according
to i Jn. 2 22 (cp Enoch 48 10), but they ' set at nought dominion
(/cvpioTTjTa), and railed at dignities (Sofas, v. &).' They are
licentious revellers, stains (cririAdSes, v. 12) in the Christian
lovefeasts, and mockers at sacred things. Although the examples of
divine judgment relate to wrong conduct, these dangerous persons
are not simply men of loose morals whose life is a peril to the church
— according to Schwegler's opinion (Nachap. Zeitalter, IjiS/!) and
Ritschl's ingenious argument marred by a somewhat strained
grammatical interpretation (St. Kr., '61, p. 103 f. ) — but also false
teachers, as is evident from their 'denying,' from the reference to the
divine judgment on those who 'believed not,' and from the
exhortation to ' contend earnestly for the faith' (v. 3). The data for a
precise determination of their doctrines amidst the many so-called
heresies of the early church are wanting, and expositors differ widely
upon the matter. Renan stands alone in the opinion that the epistle
was directed against Paul. Other scholars are divided as to whether
it assails Jewish false teachers, hyper-Paulinians, Nicolaitans,
Gnostics of the second century in general, or the Carpocratian
Gnosticism of Alexandria in particular. The character and practices of
the persons in question resemble very closely those of the Gnostics
as described by Epiphanius (Ha-r. 26 1 1). We know that these
denied that God was the ' only Ruler ' — that is, the creator and
governor of the world — and held very lax views as to the divinity of
Christ (Iren. H&r. 1 25 f.). Out of the dualism of their system
naturally sprang an indifference to all relations to the flesh ; and
hence such moral looseness as is described in the Epistle appeared
in some quarters. So close is the resemblance of the persons here
censured to the Carpocratians who flourished in Alexandria toward
the middle of the second century, that Clement believed Jude to
have written prophetically of them (Strom. 32/. ). It is, accordingly,
not improb able that the writer had them in mind as his contem
poraries. His denunciations are quite applicable to a sect who had
established upon lust a ' cult of righteous ness. ' With the late date
of the epistle which must be assumed from this point of view
corresponds the author's apprehension of Christian ' faith ' as a
system of doctrine or a fixed confession (v. 3). The writer uses
apocryphal apocalyptic works such as the Ascensio Mosis in which
Origen (De Princip. 3 2) found the legend concerning Michael (see
APOCALYPTIC, 3. Allusions. § 59), and the book of Enoch (6 and
10), from which he doubtless derived the story of the fallen angels
substantially in the form in which he gives it. With reference to v. 14
see also Enoch 60 (cp APOCALYPTIC, § 19). No certain conclusion as
to the date of the Epistle can, however, be drawn from the citation
of these writings. It has been argued that the author was an
Alexandrian Jewish Christian from the fact that he attaches to the
apocryphal books referred to, an equal authority with the OT — that
is, regards them as belonging to the later additions to the canon.
The epistle was probably used by the writer of 2 Peter, though
opinions are divided as to priority. It 4 Fortunes 's not surPr's'nS
that, on account of its ' brevity and the fact that it is not of doctrinal
importance, to say nothing of its making no claim to apostolical
authorship, it did not receive early recognition. Jude is referred to by
Clement of Alexandria (Strom. 82 n) as a 'catholic Epistle' written by
Jude, 'frater filiorum Joseph exstans.' Origen (/« Mt. 10 17 23 27)
mentions it as the work of Judas the brother of James ; but except
in the parts of his works which survive only in a Latin translation he
does not 2631 JUDGE designate the author as an 'apostle.'
Tertullian, on the other hand, calls the writer ' Jude the apostle ' (De
cult. fern. 1 3). The Muratorian fragment makes mention of it in a
somewhat doubtful text as the work of Jude without designating him
calls the author of the epistle ' the brother of James,' and attributes
its rejection by many to its citation of Enoch. Epiphanius (Htzr. 76)
speaks of its author as 6 a&e\b
The text on this page is estimated to be only 26.55%
accurate

JUDGES (BOOK) JUDGES (BOOK) Title and place in Canon


(§ i). Redaction (§ 14). Contents (§ 2). Chronology (§ 15). Sources
(§ 3). Ultimate sources (g 16). Analysis (§§ 4-13). Historical value (§
17). Minor Judges (§ 9). Text (§ 18). Literature (§ 19). The title
Judges is a translation of the Hebrew name of the book,
D''OD1K>l(KpiTv
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like