100% found this document useful (1 vote)
66 views

(eTextbook PDF) for Starting Out with Java: From Control Structures through Objects, 7th Edition instant download

The document provides links to download various eTextbooks, including 'Starting Out with Java: From Control Structures through Objects, 7th Edition' and other related programming books. It includes a detailed table of contents for the Java textbook, covering topics such as Java fundamentals, decision structures, loops, methods, and classes. Additionally, it features ISBN information and classifications for the textbooks.

Uploaded by

gandheassoah
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
100% found this document useful (1 vote)
66 views

(eTextbook PDF) for Starting Out with Java: From Control Structures through Objects, 7th Edition instant download

The document provides links to download various eTextbooks, including 'Starting Out with Java: From Control Structures through Objects, 7th Edition' and other related programming books. It includes a detailed table of contents for the Java textbook, covering topics such as Java fundamentals, decision structures, loops, methods, and classes. Additionally, it features ISBN information and classifications for the textbooks.

Uploaded by

gandheassoah
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/ 58

Download the full version and explore a variety of ebooks

or textbooks at https://ebookmass.com

(eTextbook PDF) for Starting Out with Java: From


Control Structures through Objects, 7th Edition

_____ Tap the link below to start your download _____

https://ebookmass.com/product/etextbook-pdf-for-starting-
out-with-java-from-control-structures-through-objects-7th-
edition/

Find ebooks or textbooks at ebookmass.com today!


We have selected some products that you may be interested in
Click the link to download now or visit ebookmass.com
for more options!.

Starting Out with Java: From Control Structures through


Objects 6th Edition, (Ebook PDF)

https://ebookmass.com/product/starting-out-with-java-from-control-
structures-through-objects-6th-edition-ebook-pdf/

Starting Out with Java: From Control Structures through


Data Structures 3rd Edition, (Ebook PDF)

https://ebookmass.com/product/starting-out-with-java-from-control-
structures-through-data-structures-3rd-edition-ebook-pdf/

Starting Out with C++: From Control Structures through


Objects 8th Edition, (Ebook PDF)

https://ebookmass.com/product/starting-out-with-c-from-control-
structures-through-objects-8th-edition-ebook-pdf/

Starting out with c++ From control structures through


objects Ninth Edition, Global Edition Tony Gaddis

https://ebookmass.com/product/starting-out-with-c-from-control-
structures-through-objects-ninth-edition-global-edition-tony-gaddis/
(eTextbook PDF) for Starting out with Visual C# 5th
Edition

https://ebookmass.com/product/etextbook-pdf-for-starting-out-with-
visual-c-5th-edition/

Starting Out with Visual Basic - 8th Edition Tony Gaddis

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

Starting Out With Python ( 5th International Edition )


Tony Gaddis

https://ebookmass.com/product/starting-out-with-python-5th-
international-edition-tony-gaddis/

eTextbook 978-0134382609 Starting out with Visual C# (4th


Edition)

https://ebookmass.com/product/etextbook-978-0134382609-starting-out-
with-visual-c-4th-edition/

Beginning Java Objects: From Concepts to Code, 3rd edition


Jacquie Barker

https://ebookmass.com/product/beginning-java-objects-from-concepts-to-
code-3rd-edition-jacquie-barker/
Classification: LCC QA76.73.J38 G333 2019 | DDC 005.13/3--dc23 LC
record

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

1 18

ISBN 10: 0-13-480221-7

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


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

Chapter 2 Java Fundamentals 27 

Chapter 3 Decision Structures 111 

Chapter 4 Loops and Files 189 

Chapter 5 Methods 269 

Chapter 6 A First Look at Classes 317 

Chapter 7 Arrays and the ArrayList Class 403 

Chapter 8 A Second Look at Classes and Objects 493 

Chapter 9 Text Processing and More about Wrapper Classes 557 

Chapter 10 Inheritance 611 

Chapter 11 Exceptions and Advanced File I/O 701 

Chapter 12 JavaFX: GUI Programming and Basic Controls 759 

Chapter 13 JavaFX: Advanced Controls 823 

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

Chapter 15 Recursion 999 

Chapter 16 Databases 1027 

Index 1109 

Appendices A–M Companion Website

Case Studies 1–7 Companion Website


Chapters 17–20 Companion Website
Contents
Preface xxiii 

Chapter 1 Introduction to Computers and Java 1

1.1 Introduction 1 

1.2 Why Program? 1 

1.3 Computer Systems: Hardware and Software 2 

Hardware 2 

Software 5 

1.4 Programming Languages 6 

What Is a Program? 6 

A History of Java 8 

1.5 What Is a Program Made Of? 8 

Language Elements 8 

Lines and Statements 11 

Variables 11 

The Compiler and the Java Virtual Machine 12 

Java Software Editions 13 

Compiling and Running a Java Program 14 

1.6 The Programming Process 16 

Software Engineering 18 

1.7 Object-Oriented Programming 19 

Review Questions and Exercises 21 


Programming Challenge 25 

Chapter 2 Java Fundamentals 27 

2.1 The Parts of a Java Program 27 

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

2.3 Variables and Literals 39 

Displaying Multiple Items with the + Operator 40 

Be Careful with Quotation Marks 41 

More about Literals 42 

Identifiers 42 

Class Names 44 

2.4 Primitive Data Types 44 

The Integer Data Types 46 

Floating-Point Data Types 47 

The boolean Data Type 50 

The char Data Type 50 

Variable Assignment and Initialization 52 

Variables Hold Only One Value at a Time 53 

2.5 Arithmetic Operators 54 


Integer Division 57 

Operator Precedence 57 

Grouping with Parentheses 59 

The Math Class 62 

2.6 Combined Assignment Operators 63 


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

Other Mixed Mathematical Expressions 68 

2.8 Creating Named Constants with final 69 

2.9 The String Class 70 


Objects Are Created from Classes 71 

The String Class 71 

Primitive Type Variables and Class Type Variables 71 

Creating a String Object 72 

2.10 Scope 76 

2.11 Comments 78 

2.12 Programming Style 83 

2.13 Reading Keyboard Input 85 

Reading a Character 89 

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

2.14 Dialog Boxes 93 


Displaying Message Dialogs 93 

Displaying Input Dialogs 94 

An Example Program 94 

Converting String Input to Numbers 96 

2.15 Common Errors to Avoid 99 

Review Questions and Exercises 100 

Programming Challenges 106 


Chapter 3 Decision Structures 111 

3.1 The if Statement 111 

Using Relational Operators to Form Conditions 113 

Putting It All Together 114 

Programming Style and the if Statement 117 

Be Careful with Semicolons 117 

Having Multiple Conditionally Executed Statements 118 

Flags 118 

Comparing Characters 119 

3.2 The if-else Statement 120 

3.3 Nested if Statements 122 

3.4 The if-else-if Statement 128 

3.5 Logical Operators 134 


The Precedence of Logical Operators 139 

Checking Numeric Ranges with Logical Operators 140 

3.6 Comparing String Objects 142 

Ignoring Case in String Comparisons 146 

3.7 More about Variable Declaration and Scope 147 

3.8 The Conditional Operator (Optional) 149 

3.9 The switch Statement 150 

3.10 Displaying Formatted Output with System.out.printf and

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

Specifying a Minimum Field Width 164 

Flags 167 

Formatting String Arguments 170 

The String.format Method 172 

3.11 Common Errors to Avoid 174 

Review Questions and Exercises 175 

Programming Challenges 181 

Chapter 4 Loops and Files 189 


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

4.2 The while Loop 193 

The while Loop Is a Pretest Loop 196 

Infinite Loops 196 

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

Programming Style and the while Loop 198 

4.3 Using the while Loop for Input Validation 200 

4.4 The do-while Loop 204 

4.5 The for Loop 207 

The for Loop Is a Pretest Loop 210 

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

Other Forms of the Update Expression 211 

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


Creating a User Controlled for Loop 212 

Using Multiple Statements in the Initialization and Update Expressions 213 

4.6 Running Totals and Sentinel Values 216 


Using a Sentinel Value 219 

4.7 Nested Loops 221 

4.8 The break and continue Statements (Optional) 229 

4.9 Deciding Which Loop to Use 229 

4.10 Introduction to File Input and Output 230 

Using the PrintWriter Class to Write Data to a File 230 

Appending Data to a File 236 

Specifying the File Location 237 

Reading Data from a File 237 

Reading Lines from a File with the nextLine Method 238 

Adding a throws Clause to the Method Header 241 

Checking for a File’s Existence 245 

4.11 Generating Random Numbers with the Random Class 249 

4.12 Common Errors to Avoid 255 

Review Questions and Exercises 256 

Programming Challenges 262 

Chapter 5 Methods 269 


5.1 Introduction to Methods 269 

void Methods and Value-Returning Methods 270 

Defining a void Method 271 


Calling a Method 272 

Layered Method Calls 276 

Using Documentation Comments with Methods 277 

5.2 Passing Arguments to a Method 279 


Argument and Parameter Data Type Compatibility 281 

Parameter Variable Scope 282 

Passing Multiple Arguments 282 

Arguments Are Passed by Value 284 

Passing Object References to a Method 285 

Using the @param Tag in Documentation Comments 288 

5.3 More about Local Variables 290 

Local Variable Lifetime 292 

Initializing Local Variables with Parameter Values 292 

5.4 Returning a Value from a Method 293 


Defining a Value-Returning Method 293 

Calling a Value-Returning Method 294 

Using the @return Tag in Documentation Comments 296 

Returning a boolean Value 300 

Returning a Reference to an Object 300 

5.5 Problem Solving with Methods 302 

Calling Methods That Throw Exceptions 305 

5.6 Common Errors to Avoid 305 

Review Questions and Exercises 306 


Programming Challenges 311 

Chapter 6 A First Look at Classes 317 

6.1 Objects and Classes 317 

Classes: Where Objects Come From 318 

Classes in the Java API 319 

Primitive Variables vs. Objects 321 

6.2 Writing a Simple Class, Step by Step 324 

Accessor and Mutator Methods 338 

The Importance of Data Hiding 338 

Avoiding Stale Data 339 

Showing Access Specification in UML Diagrams 339 

Data Type and Parameter Notation in UML Diagrams 339 

Layout of Class Members 340 

6.3 Instance Fields and Methods 341 

6.4 Constructors 346 

Showing Constructors in a UML Diagram 348 

Uninitialized Local Reference Variables 348 

The Default Constructor 348 

Writing Your Own No-Arg Constructor 349 

The String Class Constructor 350 

6.5 Passing Objects as Arguments 358 

6.6 Overloading Methods and Constructors 370 

The BankAccount Class 372 


Overloaded Methods Make Classes More Useful 378 

6.7 Scope of Instance Fields 378 


Shadowing 379 

6.8 Packages and import Statements 380 

Explicit and Wildcard import Statements 380 

The java.lang Package 381 

Other API Packages 381 

6.9 Focus on Object-Oriented Design: Finding the Classes and Their


Responsibilities 382 

Finding the Classes 382 

Identifying a Class’s Responsibilities 385 

This Is Only the Beginning 388 

6.10 Common Errors to Avoid 388 

Review Questions and Exercises 389 

Programming Challenges 394 

Chapter 7 Arrays and the ArrayList Class 403 


7.1 Introduction to Arrays 403 

Accessing Array Elements 405 

Inputting and Outputting Array Contents 406 

Java Performs Bounds Checking 409 

Watch Out for Off-by-One Errors 410 

Array Initialization 411 

Alternate Array Declaration Notation 412 


7.2 Processing Array Elements 413 

Array Length 415 

The Enhanced for Loop 416 

Letting the User Specify an Array’s Size 417 

Reassigning Array Reference Variables 419 

Copying Arrays 420 

7.3 Passing Arrays as Arguments to Methods 422 

7.4 Some Useful Array Algorithms and Operations 426 


Comparing Arrays 426 

Summing the Values in a Numeric Array 427 

Getting the Average of the Values in a Numeric Array 428 

Finding the Highest and Lowest Values in a Numeric Array 428 

The SalesData Class 429 

Partially Filled Arrays 437 

Working with Arrays and Files 438 

7.5 Returning Arrays from Methods 439 

7.6 String Arrays 441 

Calling String Methods from an Array Element 443 

7.7 Arrays of Objects 444 

7.8 The Sequential Search Algorithm 447 

7.9 Two-Dimensional Arrays 450 

Initializing a Two-Dimensional Array 454 

The length Field in a Two-Dimensional Array 455 


Displaying All the Elements of a Two-Dimensional Array 457 

Summing All the Elements of a Two-Dimensional Array 457 

Summing the Rows of a Two-Dimensional Array 458 

Summing the Columns of a Two-Dimensional Array 458 

Passing Two-Dimensional Arrays to Methods 459 

Ragged Arrays 461 

7.10 Arrays with Three or More Dimensions 462 

7.11 The Selection Sort and the Binary Search Algorithms 463 
The Selection Sort Algorithm 463 

The Binary Search Algorithm 466 

7.12 Command-Line Arguments and Variable-Length Argument Lists 468 

Command-Line Arguments 469 

Variable-Length Argument Lists 470 

7.13 The ArrayList Class 472 

Creating and Using an ArrayList Object 473 

Using the Enhanced for Loop with an ArrayList 474 

The ArrayList Class’s toString method 475 

Removing an Item from an ArrayList 476 

Inserting an Item 477 

Replacing an Item 478 

Capacity 479 

Storing Your Own Objects in an ArrayList 479 


Using the Diamond Operator for Type Inference 480 

7.14 Common Errors to Avoid 481 

Review Questions and Exercises 481 

Programming Challenges 486 

Chapter 8 A Second Look at Classes and Objects 493 

8.1 Static Class Members 493 


A Quick Review of Instance Fields and Instance Methods 493 

Static Members 494 

Static Fields 494 

Static Methods 497 

8.2 Passing Objects as Arguments to Methods 500 

8.3 Returning Objects from Methods 503 

8.4 The toString Method 505 

8.5 Writing an equals Method 509 

8.6 Methods That Copy Objects 512 


Copy Constructors 514 

8.7 Aggregation 515 

Aggregation in UML Diagrams 523 

Security Issues with Aggregate Classes 523 

Avoid Using null References 525 

8.8 The this Reference Variable 528 

Using this to Overcome Shadowing 529 


Using this to Call an Overloaded Constructor from Another Constructor

530 

8.9 Enumerated Types 531 


Enumerated Types Are Specialized Classes 532 

Switching On an Enumerated Type 538 

8.10 Garbage Collection 540 

The finalize Method 542 

8.11 Focus on Object-Oriented Design: Class Collaboration 542 

Determining Class Collaborations with CRC Cards 545 

8.12 Common Errors to Avoid 546 

Review Questions and Exercises 547 

Programming Challenges 551 

Chapter 9 Text Processing and More about Wrapper Classes 557 

9.1 Introduction to Wrapper Classes 557 

9.2 Character Testing and Conversion with the Character Class 558 

Character Case Conversion 563 

9.3 More String Methods 566 


Searching for Substrings 566 

Extracting Substrings 572 

Methods That Return a Modified String 576 

The Static valueOf Methods 577 

9.4 The StringBuilder Class 579 

The StringBuilder Constructors 580 

Other StringBuilder Methods 581 


The toString Method 584 

9.5 Tokenizing Strings 589 

9.6 Wrapper Classes for the Numeric Data Types 594 

The Static toString Methods 594 

The toBinaryString , toHexString , and toOctalString Methods

594 

The MIN_VALUE and MAX_VALUE Constants 595 

Autoboxing and Unboxing 595 

9.7 Focus on Problem Solving: The TestScoreReader Class 597 

9.8 Common Errors to Avoid 601 

Review Questions and Exercises 601 

Programming Challenges 605 

Chapter 10 Inheritance 611 

10.1 What Is Inheritance? 611 


Generalization and Specialization 611 

Inheritance and the “Is a” Relationship 612 

Inheritance in UML Diagrams 620 

The Superclass’s Constructor 621 

Inheritance Does Not Work in Reverse 623 

10.2 Calling the Superclass Constructor 624 

When the Superclass Has No Default or No-Arg Constructors 630 

Summary of Constructor Issues in Inheritance 631 

10.3 Overriding Superclass Methods 632 


Overloading versus Overriding 637 

Preventing a Method from Being Overridden 640 

10.4 Protected Members 641 


Package Access 646 

10.5 Chains of Inheritance 647 

Class Hierarchies 653 

10.6 The Object Class 653 

10.7 Polymorphism 655 

Polymorphism and Dynamic Binding 656 

The “Is-a” Relationship Does Not Work in Reverse 658 

The instanceof Operator 659 

10.8 Abstract Classes and Abstract Methods 660 


Abstract Classes in UML 666 

10.9 Interfaces 667 

An Interface is a Contract 669 

Fields in Interfaces 673 

Implementing Multiple Interfaces 673 

Interfaces in UML 673 

Default Methods 674 

Polymorphism and Interfaces 676 

10.10 Anonymous Inner Classes 681 

10.11 Functional Interfaces and Lambda Expressions 684 

10.12 Common Errors to Avoid 689 


Review Questions and Exercises 690 

Programming Challenges 696 

Chapter 11 Exceptions and Advanced File I/O 701 


11.1 Handling Exceptions 701 
Exception Classes 702 

Handling an Exception 703 

Retrieving the Default Error Message 707 

Polymorphic References to Exceptions 710 

Using Multiple catch Clauses to Handle Multiple Exceptions 710 

The finally Clause 718 

The Stack Trace 720 

Handling Multiple Exceptions with One catch Clause 721 

When an Exception Is Not Caught 723 

Checked and Unchecked Exceptions 724 

11.2 Throwing Exceptions 725 


Creating Your Own Exception Classes 728 

Using the @exception Tag in Documentation Comments 731 

11.3 Advanced Topics: Binary Files, Random Access Files, and Object Serialization
732 

Binary Files 732 

Random Access Files 739 

Object Serialization 744 

Serializing Aggregate Objects 748 


11.4 Common Errors to Avoid 749 

Review Questions and Exercises 749 

Programming Challenges 755 

Chapter 12 JavaFX: GUI Programming and Basic Controls 759 

12.1 Graphical User Interfaces 759 


Event-Driven GUI Programs 761 

12.2 Introduction to JavaFX 762 

Controls 762 

Stages and Scenes 763 

The Application Class 763 

12.3 Creating Scenes 765 


Creating Controls 766 

Creating Layout Containers 766 

Creating a Scene Object 767 

Adding the Scene Object to the Stage 768 

Setting the Size of the Scene 770 

Aligning Controls in an HBox Layout Container 770 

12.4 Displaying Images 772 


Loading Images from an Internet Location 775 

Setting the Size of an Image 775 

Preserving the Image’s Aspect Ratio 775 

Changing an ImageView’s Image 776 

12.5 More about the HBox, VBox , and GridPane Layout Containers 776 
The HBox Layout Container 777 

The VBox Layout Container 782 

The GridPane Layout Container 784 

Using Multiple Layout Containers in the Same Screen 791 

12.6 Button Controls and Events 792 


Handling Events 794 

Writing Event Handlers 794 

Registering an Event Handler 795 

12.7 Reading Input with TextField Controls 799 

12.8 Using Anonymous Inner Classes and Lambda Expressions to Handle Events
803 
Using Anonymous Inner Classes to Create Event Handlers 803 

Using Lambda Expressions to Create Event Handlers 806 

12.9 The BorderPane Layout Container 808 

12.10 The ObservableList Interface 812 

12.11 Common Errors to Avoid 814 

Review Questions and Exercises 814 

Programming Challenges 818 

Chapter 13 JavaFX: Advanced Controls 823 


13.1 Styling JavaFX Applications with CSS 823 

Type Selector Names 824 

Style Properties 825 

Applying a Stylesheet to a JavaFX Application 826 


Applying Styles to the Root Node 830 

Specifying Multiple Selectors in the Same Style Definition 832 

Working with Colors 832 

Creating a Custom Style Class Name 834 

ID Selectors 836 

Inline Style Rules 837 

13.2 RadioButton Controls 838 

Determining in Code Whether a RadioButton Is Selected 839 

Selecting a RadioButton in Code 839 

Responding to RadioButton Clicks 844 

13.3 CheckBox Controls 848 

Determining in Code Whether a CheckBox Is Selected 848 

Selecting a CheckBox in Code 849 

Responding to CheckBox Clicks 853 

13.4 ListView Controls 853 


Retrieving the Selected Item 855 

Retrieving the Index of the Selected Item 856 

Responding to Item Selection with an Event Handler 859 

Adding Items versus Setting Items 860 

Initializing a ListView with an Array or an ArrayList 861 

Selection Modes 862 

Retrieving Multiple Selected Items 863 


Working With the Elements of an ObservableList 866 

Converting an ObservableList to an Array 867 

Using Code to Select an Item in a ListView 868 

ListView Orientation 868 

Creating ListViews of Objects Other Than String 869 

13.5 ComboBox Controls 874 

Retrieving the Selected Item 875 

Responding to ComboBox Item Selection with an Event Handler 877 

Editable ComboBoxes 879 

13.6 Slider Controls 880 

13.7 TextArea Controls 885 

13.8 Menus 887 


Assigning Mnemonics to Menu Items 895 

13.9 The FileChooser Class 897 

Displaying a FileChooser Dialog Box 898 

13.10 Using Console Output to Debug a GUI Application 898 

13.11 Common Errors to Avoid 902 

Review Questions 902 

Programming Challenges 906 

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


14.1 Drawing Shapes 909 
The Screen Coordinate System 909 

The Shape Class and Its Subclasses 910 


The Line Class 911 

Changing the Stroke Color 914 

The Circle Class 914 

The Rectangle Class 918 

The Ellipse Class 921 

The Arc Class 924 

The Polygon Class 928 

The Polyline Class 931 

The Text Class 933 

Rotating Nodes 936 

Scaling Nodes 938 

14.2 Animation 940 

The TranslateTransition Class 941 

The RotateTransition Class 944 

The ScaleTransition Class 949 

The StrokeTransition Class 952 

The FillTransition Class 953 

The FadeTransition Class 954 

Controlling the Animation 956 

Specifying an Interpolator 956 

14.3 Effects 958 

The DropShadow Class 958 


The InnerShadow Class 961 

The ColorAdjust Class 962 

The BoxBlur , GaussianBlur , and MotionBlur Classes 962 

The SepiaTone Class 965 

The Glow Class 966 

The Reflection Class 967 

Combining Effects 967 

14.4 Playing Sound Files 969 

Registering an EndOfMedia Event Handler 971 

14.5 Playing Videos 974 

14.6 Handling Key Events 979 


Using an Anonymous Inner Class to Register a Key Event Handler to the Scene

980 

Using a Lambda Expression to Register a Key Event Handler to the Scene 981 

14.7 Handling Mouse Events 986 

14.8 Common Errors to Avoid 992 

Review Questions 992 

Programming Challenges 995 

Chapter 15 Recursion 999 

15.1 Introduction to Recursion 999 

15.2 Solving Problems with Recursion 1002 

Direct and Indirect Recursion 1006 

15.3 Examples of Recursive Methods 1007 


Summing a Range of Array Elements with Recursion 1007 

Drawing Concentric Circles 1008 

The Fibonacci Series 1011 

Finding the Greatest Common Divisor 1012 

15.4 A Recursive Binary Search Method 1014 

15.5 The Towers of Hanoi 1017 

15.6 Common Errors to Avoid 1021 

Review Questions and Exercises 1022 

Programming Challenges 1025 

Chapter 16 Databases 1027 


16.1 Introduction to Database Management Systems 1027 

JDBC 1028 

SQL 1029 

Using a DBMS 1029 

Java DB and Apache Derby 1030 

Creating the CoffeeDB Database 1030 

Connecting to the CoffeeDB Database 1030 

Connecting to a Password-Protected Database 1032 

16.2 Tables, Rows, and Columns 1033 

Column Data Types 1035 

Primary Keys 1035 

16.3 Introduction to the SQL SELECT Statement 1036 


Passing an SQL Statement to the DBMS 1038 
Specifying Search Criteria with the WHERE Clause 1048 

Sorting the Results of a SELECT Query 1054 

Mathematical Functions 1055 

16.4 Inserting Rows 1058 


Inserting Rows with JDBC 1060 

16.5 Updating and Deleting Existing Rows 1062 


Updating Rows with JDBC 1063 

Deleting Rows with the DELETE Statement 1067 

Deleting Rows with JDBC 1067 

16.6 Creating and Deleting Tables 1071 

Removing a Table with the DROP TABLE Statement 1074 

16.7 Creating a New Database with JDBC 1074 

16.8 Scrollable Result Sets 1076 

16.9 Result Set Metadata 1077 

16.10 Relational Data 1084 

Joining Data from Multiple Tables 1086 

An Order Entry System 1087 

16.11 Advanced Topics 1100 


Transactions 1100 

Stored Procedures 1101 

16.12 Common Errors to Avoid 1102 

Review Questions and Exercises 1102 

Programming Challenges 1107 


Index 1109 

The following appendices, online chapters, and online case studies are available on the
book’s online resource page at www.pearson.com/cs-resources.

Online Appendices:

Appendix A: The ASCII/Unicode Characters 

Appendix B: Operator Precedence and Associativity 

Appendix C: Java Key Words 

Appendix D: Installing the JDK and Using the JDK Documentation 

Appendix E: Using the javadoc Utility 

Appendix F: More about the Math Class 

Appendix G: Packages 

Appendix H: Working with Records and Random - Access Files 

Appendix I: Configuring Java DB and Installing Apache Derby 

Appendix J: The QuickSort Algorithm 

Appendix K: Named Colors 

Appendix L: Answers to Checkpoints 

Appendix M: Answers to Odd-Numbered Review Questions 

Online Chapters:

Chapter 17: A First look at GUI Applications 

Chapter 18: Advanced GUI Applications 

Chapter 19: Applets and More 

Chapter 20: Creating GUI Applications with JavaFX and Scene Builder 
Other documents randomly have
different content
For the fact that things actually take such a tragic course would least
of all explain the origin of a form of art; provided that art is not
merely an imitation of the reality of nature, but in truth a
metaphysical supplement to the reality of nature, placed alongside
thereof for its conquest. Tragic myth, in so far as it really belongs to
art, also fully participates in this transfiguring metaphysical purpose
of art in general: What does it transfigure, however, when it presents
the phenomenal world in the guise of the suffering hero? Least of all
the "reality" of this phenomenal world, for it says to us: "Look at
this! Look carefully! It is your life! It is the hour-hand of your clock
of existence!"
And myth has displayed this life, in order thereby to transfigure it to
us? If not, how shall we account for the æsthetic pleasure with
which we make even these representations pass before us? I am
inquiring concerning the æsthetic pleasure, and am well aware that
many of these representations may moreover occasionally create
even a moral delectation, say under the form of pity or of a moral
triumph. But he who would derive the effect of the tragic exclusively
from these moral sources, as was usually the case far too long in
æsthetics, let him not think that he has done anything for Art
thereby; for Art must above all insist on purity in her domain. For the
explanation of tragic myth the very first requirement is that the
pleasure which characterises it must be sought in the purely
æsthetic sphere, without encroaching on the domain of pity, fear, or
the morally-sublime. How can the ugly and the discordant, the
substance of tragic myth, excite an æsthetic pleasure?
Here it is necessary to raise ourselves with a daring bound into a
metaphysics of Art. I repeat, therefore, my former proposition, that
it is only as an æsthetic phenomenon that existence and the world,
appear justified: and in this sense it is precisely the function of tragic
myth to convince us that even the Ugly and Discordant is an artistic
game which the will, in the eternal fulness of its joy, plays with itself.
But this not easily comprehensible proto-phenomenon of Dionysian
Art becomes, in a direct way, singularly intelligible, and is
immediately apprehended in the wonderful significance of musical
dissonance: just as in general it is music alone, placed in contrast to
the world, which can give us an idea as to what is meant by the
justification of the world as an æsthetic phenomenon. The joy that
the tragic myth excites has the same origin as the joyful sensation of
dissonance in music. The Dionysian, with its primitive joy
experienced in pain itself, is the common source of music and tragic
myth.
Is it not possible that by calling to our aid the musical relation of
dissonance, the difficult problem of tragic effect may have
meanwhile been materially facilitated? For we now understand what
it means to wish to view tragedy and at the same time to have a
longing beyond the viewing: a frame of mind, which, as regards the
artistically employed dissonance, we should simply have to
characterise by saying that we desire to hear and at the same time
have a longing beyond the hearing. That striving for the infinite, the
pinion-flapping of longing, accompanying the highest delight in the
clearly-perceived reality, remind one that in both states we have to
recognise a Dionysian phenomenon, which again and again reveals
to us anew the playful up-building and demolishing of the world of
individuals as the efflux of a primitive delight, in like manner as
when Heraclitus the Obscure compares the world-building power to
a playing child which places stones here and there and builds
sandhills only to overthrow them again.
Hence, in order to form a true estimate of the Dionysian capacity of
a people, it would seem that we must think not only of their music,
but just as much of their tragic myth, the second witness of this
capacity. Considering this most intimate relationship between music
and myth, we may now in like manner suppose that a degeneration
and depravation of the one involves a deterioration of the other: if it
be true at all that the weakening of the myth is generally expressive
of a debilitation of the Dionysian capacity. Concerning both, however,
a glance at the development of the German genius should not leave
us in any doubt; in the opera just as in the abstract character of our
myth-less existence, in an art sunk to pastime just as in a life guided
by concepts, the inartistic as well as life-consuming nature of
Socratic optimism had revealed itself to us. Yet there have been
indications to console us that nevertheless in some inaccessible
abyss the German spirit still rests and dreams, undestroyed, in
glorious health, profundity, and Dionysian strength, like a knight
sunk in slumber: from which abyss the Dionysian song rises to us to
let us know that this German knight even still dreams his primitive
Dionysian myth in blissfully earnest visions. Let no one believe that
the German spirit has for ever lost its mythical home when it still
understands so obviously the voices of the birds which tell of that
home. Some day it will find itself awake in all the morning freshness
of a deep sleep: then it will slay the dragons, destroy the malignant
dwarfs, and waken Brünnhilde—and Wotan's spear itself will be
unable to obstruct its course!
My friends, ye who believe in Dionysian music, ye know also what
tragedy means to us. There we have tragic myth, born anew from
music,—and in this latest birth ye can hope for everything and forget
what is most afflicting. What is most afflicting to all of us, however,
is—the prolonged degradation in which the German genius has lived
estranged from house and home in the service of malignant dwarfs.
Ye understand my allusion—as ye will also, in conclusion, understand
my hopes.

25.

Music and tragic myth are equally the expression of the Dionysian
capacity of a people, and are inseparable from each other. Both
originate in an ultra Apollonian sphere of art; both transfigure a
region in the delightful accords of which all dissonance, just like the
terrible picture of the world, dies charmingly away; both play with
the sting of displeasure, trusting to their most potent magic; both
justify thereby the existence even of the "worst world." Here the
Dionysian, as compared with the Apollonian, exhibits itself as the
eternal and original artistic force, which in general calls into
existence the entire world of phenomena: in the midst of which a
new transfiguring appearance becomes necessary, in order to keep
alive the animated world of individuation. If we could conceive an
incarnation of dissonance—and what is man but that?—then, to be
able to live this dissonance would require a glorious illusion which
would spread a veil of beauty over its peculiar nature. This is the
true function of Apollo as deity of art: in whose name we comprise
all the countless manifestations of the fair realm of illusion, which
each moment render life in general worth living and make one
impatient for the experience of the next moment.
At the same time, just as much of this basis of all existence—the
Dionysian substratum of the world—is allowed to enter into the
consciousness of human beings, as can be surmounted again by the
Apollonian transfiguring power, so that these two art-impulses are
constrained to develop their powers in strictly mutual proportion,
according to the law of eternal justice. When the Dionysian powers
rise with such vehemence as we experience at present, there can be
no doubt that, veiled in a cloud, Apollo has already descended to us;
whose grandest beautifying influences a coming generation will
perhaps behold.
That this effect is necessary, however, each one would most surely
perceive by intuition, if once he found himself carried back—even in
a dream—into an Old-Hellenic existence. In walking under high Ionic
colonnades, looking upwards to a horizon defined by clear and noble
lines, with reflections of his transfigured form by his side in shining
marble, and around him solemnly marching or quietly moving men,
with harmoniously sounding voices and rhythmical pantomime,
would he not in the presence of this perpetual influx of beauty have
to raise his hand to Apollo and exclaim: "Blessed race of Hellenes!
How great Dionysus must be among you, when the Delian god
deems such charms necessary to cure you of your dithyrambic
madness!"—To one in this frame of mind, however, an aged
Athenian, looking up to him with the sublime eye of Æschylus, might
answer: "Say also this, thou curious stranger: what sufferings this
people must have undergone, in order to be able to become thus
beautiful! But now follow me to a tragic play, and sacrifice with me
in the temple of both the deities!"
APPENDIX.

[Late in the year 1888, not long before he was overcome by his
sudden attack of insanity, Nietzsche wrote down a few notes
concerning his early work, the Birth of Tragedy. These were printed
in his sister's biography (Das Leben Friedrich Nietzsches, vol. ii. pt. i.
pp. 102 ff.), and are here translated as likely to be of interest to
readers of this remarkable work. They also appear in the Ecce
Homo.—TRANSLATOR'S NOTE.]
"To be just to the Birth of Tragedy(1872), one will have to forget
some few things. It has wrought effects, it even fascinated through
that wherein it was amiss—through its application to Wagnerism,
just as if this Wagnerism were symptomatic of a rise and going up.
And just on that account was the book an event in Wagner's life:
from thence and only from thence were great hopes linked to the
name of Wagner. Even to-day people remind me, sometimes right in
the midst of a talk on Parsifal, that I and none other have it on my
conscience that such a high opinion of the cultural value of this
movement came to the top. More than once have I found the book
referred to as 'the Re-birth of Tragedy out of the Spirit of Music': one
only had an ear for a new formula of Wagner's art, aim, task,—and
failed to hear withal what was at bottom valuable therein. 'Hellenism
and Pessimism' had been a more unequivocal title: namely, as a first
lesson on the way in which the Greeks got the better of pessimism,
—on the means whereby they overcame it. Tragedy simply proves
that the Greeks were no pessimists: Schopenhauer was mistaken
here as he was mistaken in all other things. Considered with some
neutrality, the Birth of Tragedy appears very unseasonable: one
would not even dream that it was begun amid the thunders of the
battle of Wörth. I thought these problems through and through
before the walls of Metz in cold September nights, in the midst of
the work of nursing the sick; one might even believe the book to be
fifty years older. It is politically indifferent—un-German one will say
to-day,—it smells shockingly Hegelian, in but a few formulæ does it
scent of Schopenhauer's funereal perfume. An 'idea'—the antithesis
of 'Dionysian versus Apollonian'—translated into metaphysics; history
itself as the evolution of this 'idea'; the antithesis dissolved into
oneness in Tragedy; through this optics things that had never yet
looked into one another's face, confronted of a sudden, and
illumined and comprehended through one another: for instance,
Opera and Revolution. The two decisive innovations of the book are,
on the one hand, the comprehension of the Dionysian phenomenon
among the Greeks (it gives the first psychology thereof, it sees
therein the One root of all Grecian art); on the other, the
comprehension of Socratism: Socrates diagnosed for the first time as
the tool of Grecian dissolution, as a typical decadent. 'Rationality'
against instinct! 'Rationality' at any price as a dangerous, as a life-
undermining force! Throughout the whole book a deep hostile
silence on Christianity: it is neither Apollonian nor Dionysian; it
negatives all æsthetic values (the only values recognised by the Birth
of Tragedy), it is in the widest sense nihilistic, whereas in the
Dionysian symbol the utmost limit of affirmation is reached. Once or
twice the Christian priests are alluded to as a 'malignant kind of
dwarfs,' as 'subterraneans.'"

2.

"This beginning is singular beyond measure. I had for my own


inmost experience discovered the only symbol and counterpart of
history,—I had just thereby been the first to grasp the wonderful
phenomenon of the Dionysian. And again, through my diagnosing
Socrates as a decadent, I had given a wholly unequivocal proof of
how little risk the trustworthiness of my psychological grasp would
run of being weakened by some moralistic idiosyncrasy—to view
morality itself as a symptom of decadence is an innovation, a novelty
of the first rank in the history of knowledge. How far I had leaped in
either case beyond the smug shallow-pate-gossip of optimism contra
pessimism! I was the first to see the intrinsic antithesis: here, the
degenerating instinct which, with subterranean vindictiveness, turns
against life (Christianity, the philosophy of Schopenhauer, in a certain
sense already the philosophy of Plato, all idealistic systems as typical
forms), and there, a formula of highest affirmation, born of fullness
and overfullness, a yea-saying without reserve to suffering's self, to
guilt's self, to all that is questionable and strange in existence itself.
This final, cheerfullest, exuberantly mad-and-merriest Yea to life is
not only the highest insight, it is also the deepest, it is that which is
most rigorously confirmed and upheld by truth and science. Naught
that is, is to be deducted, naught is dispensable; the phases of
existence rejected by the Christians and other nihilists are even of an
infinitely higher order in the hierarchy of values than that which the
instinct of decadence sanctions, yea durst sanction. To comprehend
this courage is needed, and, as a condition thereof, a surplus of
strength: for precisely in degree as courage dares to thrust forward,
precisely according to the measure of strength, does one approach
truth. Perception, the yea-saying to reality, is as much a necessity to
the strong as to the weak, under the inspiration of weakness,
cowardly shrinking, and flight from reality—the 'ideal.' ... They are
not free to perceive: the decadents have need of the lie,—it is one of
their conditions of self-preservation. Whoso not only comprehends
the word Dionysian, but also grasps his self in this word, requires no
refutation of Plato or of Christianity or of Schopenhauer—he smells
the putrefaction."

3.

"To what extent I had just thereby found the concept 'tragic,' the
definitive perception of the psychology of tragedy, I have but lately
stated in the Twilight of the Idols, page 139 (1st edit.): 'The
affirmation of life, even in its most unfamiliar and severe problems,
the will to life, enjoying its own inexhaustibility in the sacrifice of its
highest types,—that is what I called Dionysian, that is what I divined
as the bridge to a psychology of the tragic poet. Not in order to get
rid of terror and pity, not to purify from a dangerous passion by its
vehement discharge (it was thus that Aristotle misunderstood it);
but, beyond terror and pity, to realise in fact the eternal delight of
becoming, that delight which even involves in itself the joy of
annihilating![1] In this sense I have the right to understand myself to
be the first tragic philosopher—that is, the utmost antithesis and
antipode to a pessimistic philosopher. Prior to myself there is no such
translation of the Dionysian into the philosophic pathos: there lacks
the tragic wisdom,—I have sought in vain for an indication thereof
even among the great Greeks of philosophy, the thinkers of the two
centuries before Socrates. A doubt still possessed me as touching
Heraclitus, in whose proximity I in general begin to feel warmer and
better than anywhere else. The affirmation of transiency and
annihilation, to wit the decisive factor in a Dionysian philosophy, the
yea-saying to antithesis and war, to becoming, with radical rejection
even of the concept 'being,'—that I must directly acknowledge as, of
all thinking hitherto, the nearest to my own. The doctrine of 'eternal
recurrence,' that is, of the unconditioned and infinitely repeated
cycle of all things—this doctrine of Zarathustra's might after all have
been already taught by Heraclitus. At any rate the portico[2] which
inherited well-nigh all its fundamental conceptions from Heraclitus,
shows traces thereof."
Facsimile of Nietzsches handwriting.

4.

"In this book speaks a prodigious hope. In fine, I see no reason


whatever for taking back my hope of a Dionysian future for music.
Let us cast a glance a century ahead, let us suppose my assault
upon two millenniums of anti-nature and man-vilification succeeds!
That new party of life which will take in hand the greatest of all
tasks, the upbreeding of mankind to something higher,—add thereto
the relentless annihilation of all things degenerating and parasitic,
will again make possible on earth that too-much of life, from which
there also must needs grow again the Dionysian state. I promise a
tragic age: the highest art in the yea-saying to life, tragedy, will be
born anew, when mankind have behind them the consciousness of
the hardest but most necessary wars, without suffering therefrom. A
psychologist might still add that what I heard in my younger years in
Wagnerian music had in general naught to do with Wagner; that
when I described Wagnerian music I described what I had heard,
that I had instinctively to translate and transfigure all into the new
spirit which I bore within myself...."
[1] Mr. Common's translation, pp. 227-28.
[2] Greek: στοά.

TRANSLATOR'S NOTE.

While the translator flatters himself that this version of Nietzsche's


early work—having been submitted to unsparingly scrutinising eyes
—is not altogether unworthy of the original, he begs to state that he
holds twentieth-century English to be a rather unsatisfactory vehicle
for philosophical thought. Accordingly, in conjunction with his friend
Dr. Ernest Lacy, he has prepared a second, more unconventional
translation,—in brief, a translation which will enable one whose
knowledge of English extends to, say, the period of Elizabeth, to
appreciate Nietzsche in more forcible language, because the
language of a stronger age. It is proposed to provide this second
translation with an appendix, containing many references to the
translated writings of Wagner and Schopenhauer; to the works of
Pater, Browning, Burckhardt, Rohde, and others, and a summmary
and index.
For help in preparing the present translation, the translator wishes to
express his thanks to his friends Dr. Ernest Lacy, Litt.D.; Dr. James
Waddell Tupper, Ph.D.; Prof. Harry Max Ferren; Mr. James M'Kirdy,
Pittsburg; and Mr. Thomas Common, Edinburgh.
WILLIAM AUGUST HAUSSMANN,
A.B., Ph.D.
*** END OF THE PROJECT GUTENBERG EBOOK THE BIRTH OF
TRAGEDY; OR, HELLENISM AND PESSIMISM ***

Updated editions will replace the previous one—the old editions


will be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States
copyright in these works, so the Foundation (and you!) can copy
and distribute it in the United States without permission and
without paying copyright royalties. Special rules, set forth in the
General Terms of Use part of this license, apply to copying and
distributing Project Gutenberg™ electronic works to protect the
PROJECT GUTENBERG™ concept and trademark. Project
Gutenberg is a registered trademark, and may not be used if
you charge for an eBook, except by following the terms of the
trademark license, including paying royalties for use of the
Project Gutenberg trademark. If you do not charge anything for
copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such
as creation of derivative works, reports, performances and
research. Project Gutenberg eBooks may be modified and
printed and given away—you may do practically ANYTHING in
the United States with eBooks not protected by U.S. copyright
law. Redistribution is subject to the trademark license, especially
commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the


free distribution of electronic works, by using or distributing this
work (or any other work associated in any way with the phrase
“Project Gutenberg”), you agree to comply with all the terms of
the Full Project Gutenberg™ License available with this file or
online at www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand,
agree to and accept all the terms of this license and intellectual
property (trademark/copyright) agreement. If you do not agree
to abide by all the terms of this agreement, you must cease
using and return or destroy all copies of Project Gutenberg™
electronic works in your possession. If you paid a fee for
obtaining a copy of or access to a Project Gutenberg™
electronic work and you do not agree to be bound by the terms
of this agreement, you may obtain a refund from the person or
entity to whom you paid the fee as set forth in paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only


be used on or associated in any way with an electronic work by
people who agree to be bound by the terms of this agreement.
There are a few things that you can do with most Project
Gutenberg™ electronic works even without complying with the
full terms of this agreement. See paragraph 1.C below. There
are a lot of things you can do with Project Gutenberg™
electronic works if you follow the terms of this agreement and
help preserve free future access to Project Gutenberg™
electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright
law in the United States and you are located in the United
States, we do not claim a right to prevent you from copying,
distributing, performing, displaying or creating derivative works
based on the work as long as all references to Project
Gutenberg are removed. Of course, we hope that you will
support the Project Gutenberg™ mission of promoting free
access to electronic works by freely sharing Project Gutenberg™
works in compliance with the terms of this agreement for
keeping the Project Gutenberg™ name associated with the
work. You can easily comply with the terms of this agreement
by keeping this work in the same format with its attached full
Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.

1.E. Unless you have removed all references to Project


Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project
Gutenberg™ work (any work on which the phrase “Project
Gutenberg” appears, or with which the phrase “Project
Gutenberg” is associated) is accessed, displayed, performed,
viewed, copied or distributed:

This eBook is for the use of anyone anywhere in the United


States and most other parts of the world at no cost and
with almost no restrictions whatsoever. You may copy it,
give it away or re-use it under the terms of the Project
Gutenberg License included with this eBook or online at
www.gutenberg.org. If you are not located in the United
States, you will have to check the laws of the country
where you are located before using this eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is


derived from texts not protected by U.S. copyright law (does not
contain a notice indicating that it is posted with permission of
the copyright holder), the work can be copied and distributed to
anyone in the United States without paying any fees or charges.
If you are redistributing or providing access to a work with the
phrase “Project Gutenberg” associated with or appearing on the
work, you must comply either with the requirements of
paragraphs 1.E.1 through 1.E.7 or obtain permission for the use
of the work and the Project Gutenberg™ trademark as set forth
in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is


posted with the permission of the copyright holder, your use and
distribution must comply with both paragraphs 1.E.1 through
1.E.7 and any additional terms imposed by the copyright holder.
Additional terms will be linked to the Project Gutenberg™
License for all works posted with the permission of the copyright
holder found at the beginning of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files
containing a part of this work or any other work associated with
Project Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute


this electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the
Project Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™
works unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or


providing access to or distributing Project Gutenberg™
electronic works provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project


Gutenberg™ electronic work or group of works on different
terms than are set forth in this agreement, you must obtain
permission in writing from the Project Gutenberg Literary
Archive Foundation, the manager of the Project Gutenberg™
trademark. Contact the Foundation as set forth in Section 3
below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on,
transcribe and proofread works not protected by U.S. copyright
law in creating the Project Gutenberg™ collection. Despite these
efforts, Project Gutenberg™ electronic works, and the medium
on which they may be stored, may contain “Defects,” such as,
but not limited to, incomplete, inaccurate or corrupt data,
transcription errors, a copyright or other intellectual property
infringement, a defective or damaged disk or other medium, a
computer virus, or computer codes that damage or cannot be
read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except


for the “Right of Replacement or Refund” described in
paragraph 1.F.3, the Project Gutenberg Literary Archive
Foundation, the owner of the Project Gutenberg™ trademark,
and any other party distributing a Project Gutenberg™ electronic
work under this agreement, disclaim all liability to you for
damages, costs and expenses, including legal fees. YOU AGREE
THAT YOU HAVE NO REMEDIES FOR NEGLIGENCE, STRICT
LIABILITY, BREACH OF WARRANTY OR BREACH OF CONTRACT
EXCEPT THOSE PROVIDED IN PARAGRAPH 1.F.3. YOU AGREE
THAT THE FOUNDATION, THE TRADEMARK OWNER, AND ANY
DISTRIBUTOR UNDER THIS AGREEMENT WILL NOT BE LIABLE
TO YOU FOR ACTUAL, DIRECT, INDIRECT, CONSEQUENTIAL,
PUNITIVE OR INCIDENTAL DAMAGES EVEN IF YOU GIVE
NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of
receiving it, you can receive a refund of the money (if any) you
paid for it by sending a written explanation to the person you
received the work from. If you received the work on a physical
medium, you must return the medium with your written
explanation. The person or entity that provided you with the
defective work may elect to provide a replacement copy in lieu
of a refund. If you received the work electronically, the person
or entity providing it to you may choose to give you a second
opportunity to receive the work electronically in lieu of a refund.
If the second copy is also defective, you may demand a refund
in writing without further opportunities to fix the problem.

1.F.4. Except for the limited right of replacement or refund set


forth in paragraph 1.F.3, this work is provided to you ‘AS-IS’,
WITH NO OTHER WARRANTIES OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of
damages. If any disclaimer or limitation set forth in this
agreement violates the law of the state applicable to this
agreement, the agreement shall be interpreted to make the
maximum disclaimer or limitation permitted by the applicable
state law. The invalidity or unenforceability of any provision of
this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the


Foundation, the trademark owner, any agent or employee of the
Foundation, anyone providing copies of Project Gutenberg™
electronic works in accordance with this agreement, and any
volunteers associated with the production, promotion and
distribution of Project Gutenberg™ electronic works, harmless
from all liability, costs and expenses, including legal fees, that
arise directly or indirectly from any of the following which you
do or cause to occur: (a) distribution of this or any Project
Gutenberg™ work, (b) alteration, modification, or additions or
deletions to any Project Gutenberg™ work, and (c) any Defect
you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new
computers. It exists because of the efforts of hundreds of
volunteers and donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project
Gutenberg™’s goals and ensuring that the Project Gutenberg™
collection will remain freely available for generations to come. In
2001, the Project Gutenberg Literary Archive Foundation was
created to provide a secure and permanent future for Project
Gutenberg™ and future generations. To learn more about the
Project Gutenberg Literary Archive Foundation and how your
efforts and donations can help, see Sections 3 and 4 and the
Foundation information page at www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-
profit 501(c)(3) educational corporation organized under the
laws of the state of Mississippi and granted tax exempt status
by the Internal Revenue Service. The Foundation’s EIN or
federal tax identification number is 64-6221541. Contributions
to the Project Gutenberg Literary Archive Foundation are tax
deductible to the full extent permitted by U.S. federal laws and
your state’s laws.

The Foundation’s business office is located at 809 North 1500


West, Salt Lake City, UT 84116, (801) 596-1887. Email contact
links and up to date contact information can be found at the
Foundation’s website and official page at
www.gutenberg.org/contact
Section 4. Information about Donations to
the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission
of increasing the number of public domain and licensed works
that can be freely distributed in machine-readable form
accessible by the widest array of equipment including outdated
equipment. Many small donations ($1 to $5,000) are particularly
important to maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws


regulating charities and charitable donations in all 50 states of
the United States. Compliance requirements are not uniform
and it takes a considerable effort, much paperwork and many
fees to meet and keep up with these requirements. We do not
solicit donations in locations where we have not received written
confirmation of compliance. To SEND DONATIONS or determine
the status of compliance for any particular state visit
www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states


where we have not met the solicitation requirements, we know
of no prohibition against accepting unsolicited donations from
donors in such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot


make any statements concerning tax treatment of donations
received from outside the United States. U.S. laws alone swamp
our small staff.

Please check the Project Gutenberg web pages for current


donation methods and addresses. Donations are accepted in a
number of other ways including checks, online payments and
credit card donations. To donate, please visit:
www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could
be freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose
network of volunteer support.

Project Gutenberg™ eBooks are often created from several


printed editions, all of which are confirmed as not protected by
copyright in the U.S. unless a copyright notice is included. Thus,
we do not necessarily keep eBooks in compliance with any
particular paper edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg
Literary Archive Foundation, how to help produce our new
eBooks, and how to subscribe to our email newsletter to hear
about new eBooks.
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like