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

Java TM Programming From Problem Analysis to Program Design 5th Edition D. S. Malik - The ebook version is available in PDF and DOCX for easy access

The document provides information on the 5th edition of 'Java TM Programming From Problem Analysis to Program Design' by D. S. Malik, including download links and ISBN details. It also lists additional related ebooks available for download on ebookultra.com. The content covers various aspects of Java programming, including basic elements, control structures, and object-oriented design.

Uploaded by

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

Java TM Programming From Problem Analysis to Program Design 5th Edition D. S. Malik - The ebook version is available in PDF and DOCX for easy access

The document provides information on the 5th edition of 'Java TM Programming From Problem Analysis to Program Design' by D. S. Malik, including download links and ISBN details. It also lists additional related ebooks available for download on ebookultra.com. The content covers various aspects of Java programming, including basic elements, control structures, and object-oriented design.

Uploaded by

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

Visit https://ebookultra.

com to download the full version and


explore more ebooks

Java TM Programming From Problem Analysis to


Program Design 5th Edition D. S. Malik

_____ Click the link below to download _____


https://ebookultra.com/download/java-tm-programming-
from-problem-analysis-to-program-design-5th-edition-d-
s-malik/

Explore and download more ebooks at ebookultra.com


Here are some suggested products you might be interested in.
Click the link to download

C programming from problem analysis to program design 4th


ed Edition D S Malik

https://ebookultra.com/download/c-programming-from-problem-analysis-
to-program-design-4th-ed-edition-d-s-malik/

The Java TM Programming Language 4th Edition Ken Arnold

https://ebookultra.com/download/the-java-tm-programming-language-4th-
edition-ken-arnold/

Java Programs to Accompany Programming Logic and Design


7th Edition Jo Ann Smith

https://ebookultra.com/download/java-programs-to-accompany-
programming-logic-and-design-7th-edition-jo-ann-smith/

Beginning Programming with Java for Dummies 5th Edition


Barry Burd

https://ebookultra.com/download/beginning-programming-with-java-for-
dummies-5th-edition-barry-burd/
Problem Solving and Program Design in C Third Edition Jeri
R. Hanly

https://ebookultra.com/download/problem-solving-and-program-design-in-
c-third-edition-jeri-r-hanly/

Java How to Program Early Objects 10th ed Edition Deitel

https://ebookultra.com/download/java-how-to-program-early-
objects-10th-ed-edition-deitel/

Java concepts 5th Edition Cay S. Horstmann

https://ebookultra.com/download/java-concepts-5th-edition-cay-s-
horstmann/

Java the UML way integrating object oriented design and


programming Else Lervik

https://ebookultra.com/download/java-the-uml-way-integrating-object-
oriented-design-and-programming-else-lervik/

Java TM Application Development on Linux R 1st Edition


Carl Albing

https://ebookultra.com/download/java-tm-application-development-on-
linux-r-1st-edition-carl-albing/
Java TM Programming From Problem Analysis to
Program Design 5th Edition D. S. Malik Digital Instant
Download
Author(s): D. S. Malik
ISBN(s): 9781111530532, 111153053X
Edition: 5
File Details: PDF, 3.43 MB
Year: 2011
Language: english
Licensed to: iChapters User
Licensed to: iChapters User

JAVA PROGRAMMING
FROM PROBLEM ANALYSIS TO PROGRAM DESIGN

FIFTH EDITION

D.S. MALIK

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

Copyright 2011 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.
Licensed to: iChapters User

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.

Copyright 2011 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.

!"#$%&$$&'(&)*+),,-*.*/00111** "2323$11133456475189
Licensed to: iChapters User

Java Programming: From Problem Analysis ª 2012 Course Technology, Cengage Learning
to Program Design, Fifth Edition
ALL RIGHTS RESERVED. No part of this work covered by the
D.S. Malik copyright herein may be reproduced, transmitted, stored or used
Executive Editor: Marie Lee in any form or by any means graphic, electronic, or mechanical,
including but not limited to photocopying, recording, scanning,
Acquisitions Editor: Brandi Shailer digitizing, taping, Web distribution, information networks, or
Senior Product Manager: Alyssa Pratt information storage and retrieval systems, except as permitted
Editorial Assistant: Jacqueline Lacaire under Section 107 or 108 of the 1976 United States Copyright Act,
without the prior written permission of the publisher.
Content Project Manager: Lisa Weidenfeld
Associate Marketing Manager: Shanna For product information and technology assistance, contact us at
Shelton Cengage Learning Customer & Sales Support, 1-800-354-9706
Art Director: Faith Brosnan For permission to use material from this text or product, submit
all requests online at www.cengage.com/permissions
Proofreader: Andrea Schein
Further permissions questions can be emailed to
Indexer: Alexandra Nickerson [email protected]
Print Buyer: Julio Esperas
Cover Designer: Roycroft Design/
www.roycroftdesign.com Library of Congress Control Number: 2010940363
Cover Photo: ª photolibrary/Richard ISBN-13: 978-1-111-53053-2
Cummins ISBN-10: 1-111-53053-x
Compositor: Integra Course Technology
20 Channel Center Street
Boston, MA 02210
Some of the product names and company
USA
names used in this book have been used for
identification purposes only and may be
trademarks or registered trademarks of their Cengage Learning is a leading provider of customized
respective manufacturers and sellers. learning solutions with office locations around the globe,
including Singapore, the United Kingdom, Australia, Mexico,
Any fictional data related to persons or
Brazil and Japan. Locate your local office at:
companies or URLs used throughout this
www.cengage.com/global
book is intended for instructional purposes
only. At the time this book was printed, any Cengage Learning products are represented in Canada by
such data was fictional and not belonging to Nelson Education, Ltd.
any real persons or companies.
To learn more about Course Technology, visit
Course Technology, a part of Cengage www.cengage.com/coursetechnology
Learning, reserves the right to revise this
Purchase any of our products at your local college store
publication and make changes from time to
or at our preferred online store www.cengagebrain.com
time in its content without notice.
The programs in this book are for
instructional purposes only. They have been
tested with care, but are not guaranteed for
any particular intent beyond educational
purposes. The author and the publisher do
not offer any warranties or representations,
nor do they accept any liabilities with respect
to the programs.

Printed in the United States of America


1 2 3 4 5 6 7 16 15 14 13 12 11 10

Copyright 2011 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.
Licensed to: iChapters User

TO

My Daughter

Shelly Malik

Copyright 2011 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.
Licensed to: iChapters User

Copyright 2011 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.
Licensed to: iChapters User

B RIEF C ONTENTS

PREFACE xix
1. An Overview of Computers and Programming Languages 1

2. Basic Elements of Java 25

3. Introduction to Objects and Input/Output 113

4. Control Structures I: Selection 177

5. Control Structures II: Repetition 249

6. Graphical User Interface (GUI) and Object-Oriented Design (OOD) 327

7. User-Defined Methods 383

8. User-Defined Classes and ADTs 465

9. Arrays 551

10. Inheritance and Polymorphism 639

11. Handling Exceptions and Events 723

12. Advanced GUIs and Graphics 783

13. Recursion 873

14. Searching and Sorting 907

APPENDIX A Java Reserved Words 939

APPENDIX B Operator Precedence 941

APPENDIX C Character Sets 945

APPENDIX D Additional Java Topics 949

APPENDIX E Answers to Odd-Numbered Exercises 997

INDEX 1023
Copyright 2011 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.
Licensed to: iChapters User

TABLE OF C ONTENTS

Preface xix

AN OVERVIEW OF COMPUTERS AND


1 PROGRAMMING LANGUAGES 1
Introduction 2

An Overview of the History of Computers 2

Elements of a Computer System 4


Hardware 4
Software 6

Language of a Computer 6

Evolution of Programming Languages 8

Processing a Java Program 10

Internet, World Wide Web, Browser, and Java 13

Programming with the Problem


Analysis–Coding–Execution Cycle 13

Programming Methodologies 19
Structured Programming 19
Object-Oriented Programming 19

Quick Review 21

Exercises 23

Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | vii

BASIC ELEMENTS OF JAVA 25


2 A Java Program 26

Basics of a Java Program 28


Comments 29
Special Symbols 30
Reserved Words (Keywords) 30
Identifiers 31

Data Types 32
Primitive Data Types 32

Arithmetic Operators and Operator Precedence 36


Order of Precedence 39

Expressions 40
Mixed Expressions 41

Type Conversion (Casting) 43

class String 45
Strings and the Operator + 46

Input 48
Allocating Memory with Named Constants and Variables 48
Putting Data into Variables 51
Declaring and Initializing Variables 55
Input (Read) Statement 56
Reading a Single Character 61

Increment and Decrement Operators 64

Output 66

Packages, Classes, Methods, and the import Statement 71

Creating a Java Application Program 72

Debugging: Understanding and Fixing Syntax Errors 77

Programming Style and Form 80


Syntax 80

Avoiding Bugs: Consistent, Proper Formatting and


Code Walk-Through 84

Copyright 2011 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.
Licensed to: iChapters User

viii | Java Programming: From Problem Analysis to Program Design, Fifth Edition

More on Assignment Statements (Optional) 85

Quick Review 94

Exercises 97

Programming Exercises 106

INTRODUCTION TO OBJECTS AND INPUT/OUTPUT 113


3 Objects and Reference Variables 114

Using Predefined Classes and Methods in a Program 118


Dot Between Class (Object) Name and Class Member: A
Precaution 120

class String 121

Input/Output 129
Formatting Output with printf 129
Using Dialog Boxes for Input/Output 139
Formatting the Output Using the String Method format 146

File Input/Output 149


Storing (Writing) Output to a File 152

Debugging: Understanding Logic Errors and


Debugging with print or println Statements 163

Quick Review 165

Exercises 167

Programming Exercises 171

CONTROL STRUCTURES I: SELECTION 177


4 Control Structures 178

Relational Operators 180

Relational Operators and Primitive Data Types 181

Logical (Boolean) Operators and Logical Expressions 183

Order of Precedence 185


boolean Data Type and Logical (Boolean) Expressions 189

Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | ix

Selection: if and if...else 190


One-Way Selection 190
Two-Way Selection 193
Compound (Block of) Statements 197
Multiple Selections: Nested if 198
Comparing if...else Statements with a Series
of if Statements 200
Short-Circuit Evaluation 201
Comparing Floating-Point Numbers for Equality:
A Precaution 202
Conditional Operator (? :) (Optional) 204

Avoiding Bugs by Avoiding Partially Understood


Concepts and Techniques 204

Program Style and Form (Revisited): Indentation 208

switch Structures 208

Avoiding Bugs by Avoiding Partially Understood


Concepts and Techniques (Revisited) 215

Comparing Strings 223


Strings, the Assignment Operator, and the Operator new 229

Quick Review 230

Exercises 232

Programming Exercises 241

CONTROL STRUCTURES II: REPETITION 249


5 Why Is Repetition Needed? 250

while Looping (Repetition) Structure 251


Designing while Loops 254
Counter-Controlled while Loops 255
Sentinel-Controlled while Loops 257
Flag-Controlled while Loops 263
EOF-Controlled while Loops 266
More on Expressions in while Statements 271

for Looping (Repetition) Structure 278

Copyright 2011 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.
Licensed to: iChapters User

x | Java Programming: From Problem Analysis to Program Design, Fifth Edition

do...while Looping (Repetition) Structure 288


Choosing the Right Looping Structure 293

break and continue Statements 293

Avoiding Bugs by Avoiding Patches 295

Debugging Loops 298

Nested Control Structures 299

Quick Review 304

Exercises 306

Programming Exercises 319

GRAPHICAL USER INTERFACE (GUI) AND


6 OBJECT-ORIENTED DESIGN (OOD) 327
Graphical User Interface (GUI) Components 328
Creating a Window 332
JFrame 332
Getting Access to the Content Pane 338
JLabel 339
JTextField 343
JButton 347

Object-Oriented Design 363


A Simplified OOD Methodology 364

Implementing Classes and Operations 370


Primitive Data Types and the Wrapper Classes 370

Quick Review 377

Exercises 378

Programming Exercises 381

USER-DEFINED METHODS 383


7 Predefined Methods 384
Using Predefined Methods in a Program 388

User-Defined Methods 391


Value-Returning Methods 391
Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | xi

return Statement 395


Final Program 398

Flow of Execution 404

Void Methods 407

Primitive Data Type Variables as Parameters 411

Reference Variables as Parameters 414


Parameters and Memory Allocation 414
Reference Variables of the String Type as Parameters:
A Precaution 414
The class StringBuffer 418

Primitive Type Wrapper Classes as Parameters 421

Scope of an Identifier Within a Class 422

Method Overloading: An Introduction 427

Debugging: Using Drivers and Stubs 440

Avoiding Bugs: One-Piece-at-a-Time Coding 442

Quick Review 442

Exercises 445

Programming Exercises 456

USER-DEFINED CLASSES AND ADTS 465


8 Classes and Objects 466
Constructors 471
Unified Modeling Language Class Diagrams 472
Variable Declaration and Object Instantiation 473
Accessing Class Members 475
Built-in Operations on Classes 476
Assignment Operator and Classes: A Precaution 476
Class Scope 478

Copyright 2011 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.
Licensed to: iChapters User

xii | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Methods and Classes 479


Definitions of the Constructors and Methods
of the class Clock 479

Classes and the Method toString 494

Copy Constructor 500

Static Members of a Class 501


static Variables (Data Members) of a Class 503

Finalizers 507

Accessor and Mutator Methods 507

Debugging—Designing and Documenting a Class 510

Reference this (Optional) 512


Cascaded Method Calls (Optional) 514

Inner Classes 517

Abstract Data Types 517

Quick Review 537

Exercises 538

Programming Exercises 547

ARRAYS 551
9 Why Do We Need Arrays? 552

Arrays 553
Alternate Ways to Declare an Array 555
Accessing Array Elements 555
Specifying Array Size during Program Execution 557
Array Initialization during Declaration 558
Arrays and the Instance Variable length 558
Processing One-Dimensional Arrays 559
Array Index Out of Bounds Exception 564
Declaring Arrays as Formal Parameters to Methods 564
Assignment Operator, Relational Operators, and Arrays:
A Precaution 565
Arrays as Parameters to Methods 567

Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | xiii

Searching an Array for a Specific Item 572

Arrays of Objects 574


Arrays of string Objects 574
Arrays of Objects of Other Classes 576

Arrays and Variable Length Parameter List (Optional) 581

Two-Dimensional Arrays 589


Accessing Array Elements 591
Two-Dimensional Array Initialization during Declaration 594
Processing Two-Dimensional Arrays 595
Passing Two-Dimensional Arrays as Parameters to Methods 599

Multidimensional Arrays 603

class Vector (Optional) 616


Primitive Data Types and the class Vector 620
Vector Objects and the foreach Loop 620

Quick Review 621

Exercises 623

Programming Exercises 634

INHERITANCE AND POLYMORPHISM 639


10 Inheritance 640
Using Methods of the Superclass in a Subclass 642
Constructors of the Superclass and Subclass 648
Protected Members of a Class 657
Protected Access vs Package Access 660

class Object 661

Java Stream Classes 663

Polymorphism 664
Operator instanceof 670

Abstract Methods and Classes 674

Interfaces 681

Copyright 2011 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.
Licensed to: iChapters User

xiv | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Polymorphism Via Interfaces 682

Composition (Aggregation) 684

Quick Review 709

Exercises 712

Programming Exercises 719

HANDLING EXCEPTIONS AND EVENTS 723


11 Handling Exceptions Within a Program 724
Java’s Mechanism of Exception Handling 727
try/catch/finally Block 728

Java Exception Hierarchy 733

Java’s Exception Classes 736

Checked and Unchecked Exceptions 741

More Examples of Exception Handling 743


class Exception and the Operator instanceof 746

Rethrowing and Throwing an Exception 749

Method printStackTrace 753

Exception-Handling Techniques 755


Terminate the Program 755
Fix the Error and Continue 756
Log the Error and Continue 757

Creating Your Own Exception Classes 758

Event Handling 760

Quick Review 775

Exercises 777

Programming Exercises 781

Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | xv

ADVANCED GUIS AND GRAPHICS 783


12 Applets 787

class Font 791

class Color 794

class Graphics 800


Converting an Application Program to an Applet 808

Additional GUI Components 811


JTextArea 811
JCheckBox 816
JRadioButton 823
JComboBox 828
JList 833

Layout Managers 839


FlowLayout 840
BorderLayout 843

Menus 844

Key and Mouse Events 847


Key Events 848
Mouse Events 850

Quick Review 865

Exercises 866

Programming Exercises 868

RECURSION 873
13
Recursive Definitions 874
Direct and Indirect Recursion 876
Infinite Recursion 877
Designing Recursive Methods 877

Problem Solving Using Recursion 878


Tower of Hanoi: Analysis 887

Recursion or Iteration? 888

Copyright 2011 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.
Licensed to: iChapters User

xvi | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Quick Review 896

Exercises 897

Programming Exercises 901

SEARCHING AND SORTING 907


14
List Processing 908
Searching 908
Selection Sort 909
Insertion Sort 913
Binary Search 917

Quick Review 934

Exercises 934

Programming Exercises 936

APPENDIX A: JAVA RESERVED WORDS 939

APPENDIX B: OPERATOR PRECEDENCE 941

APPENDIX C: CHARACTER SETS 945


ASCII (American Standard Code for Information
Interchange), the First 128 Characters of the
Unicode Character Set 945
EBCDIC (Extended Binary Coded Decimal
Interchange Code) 946

APPENDIX D: ADDITIONAL JAVA TOPICS 949


Binary (Base 2) Representation of a Nonnegative Integer 949
Converting a Base 10 Number to a Binary Number (Base 2) 949
Converting a Binary Number (Base 2) to Base 10 951
Converting a Binary Number (Base 2) to Octol (Base 8)
and Hexdecimal (Base 16) 952

Copyright 2011 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.
Licensed to: iChapters User

Table of Contents | xvii

Executing Java Programs Using the Command-Line


Statements 954
Setting the Path in Windows 7.0 (Professional) 954
Executing Java Programs 959
Java Style Documentation 964

Creating Your Own Packages 966


Multiple File Programs 969

Formatting the Output of Decimal Numbers Using


the class DecimalFormat 969

Packages and User-Defined Classes 972


Primitive Type Classes 972
Class: IntClass 972
Class: LongClass 976
Class: CharClass 977
Class: FloatClass 977
Class: DoubleClass 978
Class: BooleanClass 979
Using Primitive Type Classes in a Program 980

Enumeration Types 981

APPENDIX E: ANSWERS TO ODD-NUMBERED


EXERCISES 997
Chapter 1 997

Chapter 2 998

Chapter 3 1001

Chapter 4 1002

Chapter 5 1004

Chapter 6 1007

Chapter 7 1008

Chapter 8 1010

Chapter 9 1014

Copyright 2011 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.
Licensed to: iChapters User

xviii | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Chapter 10 1016

Chapter 11 1018

Chapter 12 1019

Chapter 13 1020

Chapter 14 1020

INDEX 1023

Copyright 2011 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.
Licensed to: iChapters User

P REFACE TO THE F IFTH


E DITION

Welcome to Java Programming: From Problem Analysis to Program Design, Fifth Edition.
Designed for a first Computer Science (CS1) Java course, this text will provide a breath of
fresh air to you and your students. The CS1 course serves as the cornerstone of the Computer
Science curriculum. My primary goal is to motivate and excite all programming students,
regardless of their level. Motivation breeds excitement for learning. Motivation and excite-
ment are critical factors that lead to the success of the programming student. This text is the
culmination and development of my classroom notes throughout more than fifty semesters of
teaching successful programming.
Warning: This text can be expected to create a serious reduction in the demand for program-
ming help during your office hours. Other side effects include significantly diminished student
dependency on others while learning to program.

The primary focus in writing this text is on student learning. Therefore, in addition to clear
explanations, we address the key issues that otherwise impede student learning. For example, a
common question that arises naturally during an early programming assignment is: ‘‘How
many variables and what kinds are needed in this program?’’ We illustrate this important and
crucial step by helping students learn why variables are needed and how data in a variable is
manipulated. Next students learn that the analysis of the problem will spill the number and
types of the variables. Once students grasp this key concept, control structures (selection and
loops) become easier to learn. The second major impediment in learning programming is
parameter passing. We pay special attention to this topic. First students learn how to use
predefined methods and how actual and formal parameters relate. Next students learn about
user-defined methods. They see visual diagrams that help them learn how methods are called
and how formal parameters affect actual parameters. Once students have a clear understanding
of these two key concepts, they readily assimilate advanced topics.
The topics are introduced at a pace that is conducive to learning. The writing style is friendly,
engaging, and straightforward. It parallels the learning style of the contemporary CS1 student.
Before introducing a key concept, the student learns why the concept is needed, and then sees
examples illustrating the concept. Special attention is paid to topics that are essential in
mastering the Java programming language and in acquiring a foundation for further study
of computer science.

Copyright 2011 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.
Licensed to: iChapters User

xx | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Other important topics include debugging techniques and techniques for avoiding programming
bugs. When a beginner compiles his/her first program and sees that the number of errors exceeds the
length of this first program, he/she becomes frustrated by the plethora of errors, only some of which
can be interpreted. To ease this frustration and help students learn to produce correct programs,
debugging and bug avoidance techniques are presented systematically throughout the text.

Changes in the Fifth Edition


The main changes are:
• In the fifth edition, new debugging sections have been added and some of the old
ones have been rewritten. These sections are indicated with a debugging icon.
• The fifth edition contains more than 125 new exercises, 27 new programming
exercises, and numerous new examples spread throughout the book.
• In Chapters 6 and 12 the GUI figures have been captured and replaced in Windows 7
Professional environment.
• Appendix D contains screen images illustrating how to compile and execute a Java
program using the command-line statements as well as how to set the path in
Windows 7 Professional environment.
These changes were implemented based on comments from the text reviewers of the fifth
edition. The source code and the programming exercises are developed and tested using Java
6.0 and the version of Java 7.0 available at the time this book was being typeset.

Approach
Once conceived as a Web programming language, Java slowly but surely found its way into
classrooms where it now serves as a first programming language in computer science curricula
(CS1). Java is a combination of traditional style programming—programming with a non-
graphical user interface—and modern style programming with a graphical user interface
(GUI). This book introduces you to both styles of programming. After giving a brief
description of each chapter, we discuss how to read this book.
Chapter 1 briefly reviews the history of computers and programming languages. The reader
can quickly skim and become familiar with some of the hardware and software components of
the computer. This chapter also gives an example of a Java program and describes how a Java
program is processed. The two basic problem-solving techniques, structured programming
and object-oriented design, are also presented.
After completing Chapter 2, students become familiar with the basics of Java and are ready to
write programs that are complicated enough to do some computations. The debugging section
in this chapter illustrates how to interpret and correct syntax errors.
The three terms that you will encounter throughout the book are—primitive type variables,
reference variables, and objects. Chapter 3 makes clear distinctions between these terms and
sets the tone for the rest of the book. An object is a fundamental entity in an object-oriented

Copyright 2011 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.
Licensed to: iChapters User

Preface to the Fifth Edition | xxi

programming language. This chapter further explains how an object works. The class
String is one of the most important classes in Java. This chapter introduces this class and
explains how various methods of this class can be used to manipulate strings. Because input/
output is fundamental to any programming language, it is introduced early, and is covered in
detail in Chapter 3. The debugging section in this chapter illustrates how to find and correct
logical errors.
Chapters 4 and 5 introduce control structures used to alter the sequential flow of execution.
The debugging sections in these chapters discuss and illustrate logical errors associated with
selection and looping structures.
Java is equipped with powerful yet easy-to-use graphical user interface (GUI) components
to create user-friendly graphical programs. Chapter 6 introduces various GUI components
and gives examples of how to use these components in Java application programs. Because
Java is an object-oriented programming language, the second part of Chapter 6 discusses
and gives examples of how to solve various problems using object-oriented design
methodology.
Chapter 7 discusses user-defined methods. Parameter passing is a fundamental concept in any
programming language. Several examples, including visual diagrams, help readers understand
this concept. It is recommended that readers with no prior programming background spend
extra time on this concept. The debugging section in this chapter discuss how to debug a
program using stubs and drivers.
Chapter 8 discusses user-defined classes. In Java, a class is an important and widely used
element. It is used to create Java programs, group related operations, and it allows users to
create their own data types. This chapter uses extensive visual diagrams to illustrate how
objects of classes manipulate data.
Chapter 9 describes arrays. This chapter also introduces variable length formal parameter lists.
In addition, this chapter introduces foreach loops and explains how this loop can be used to
process the elements of an array. This chapter also discusses the sequential searching algorithm
and the class Vector.
Inheritance is an important principle of object-oriented design. It encourages code reuse.
Chapter 10 discusses inheritance and gives various examples to illustrate how classes are
derived from existing classes. In addition, this chapter also discusses polymorphism, abstract
classes, inner classes, and composition.
An occurrence of an undesirable situation that can be detected during program execution is
called an exception. For example, division by zero is an exception. Java provides extensive
support for handing exceptions. Chapter 11 shows how to handle exceptions in a program.
Chapter 11 also discusses event handling, which was introduced in Chapter 6. Chapter 12
picks up the discussion of GUI components started in Chapter 6. This chapter introduces
additional GUI components and discusses how to create applets.
Chapter 13 introduces recursion. Several examples illustrate how recursive methods
execute.

Copyright 2011 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.
Licensed to: iChapters User

xxii | Java Programming: From Problem Analysis to Program Design, Fifth Edition

Chapter 14 discusses a binary search algorithm as well as bubble sort, selection sort, insertion
sort, and quick sort algorithms. Additional content covering the sorting algorithms bubble sort
and quick sort is provided online at www.cengagebrain.com.
Appendix A lists the reserved words in Java. Appendix B shows the precedence and
associativity of the Java operators. Appendix C lists the ASCII (American Standard Code
for Information Interchange) portion of the Unicode character set as well as the EBCDIC
(Extended Binary Code Decimal Interchange) character set.
Appendix D contains additional topics in Java. The topics covered are converting a base 10
number to binary (base 2) number and vice versa, converting a number from base 2 to base 8 (base
16) and vice versa, how to compile and execute a Java program using command line statements,
how to create Java style documentation of the user-defined classes, how to create packages, how to
use user-defined classes in a Java program, and enum type. Appendix E gives answers to the odd-
numbered exercises in the text. Those odd-numbered exercises with very long solutions will not
be in the text, but will be provided to students online at www.cengagebrain.com.

How To Use This Book


Java is a complex and very powerful language. In addition to traditional (non-GUI) program-
ming, Java provides extensive support for creating programs that use a graphical user interface
(GUI). Chapter 3 introduces graphical input and output dialog boxes. Chapter 6 introduces
the most commonly used GUI components such as labels, buttons, and text fields. More
extensive coverage of GUI components is provided in Chapter 12.
This book can be used in two ways. One way is an integrated approach in which readers learn
how to write both non-GUI and GUI programs as they learn basic programming concepts
and skills. The other approach focuses on illustrating fundamental programming concepts
with non-GUI programming first, and later incorporating GUI components. The recom-
mended chapter sequence for each of these approaches is as follows:
• Integrated approach: Study all chapters in sequence.
• Non-GUI first, then GUI: Study Chapters 1–5 in sequence. Then study Chapters
7–11 and Chapters 13 and 14. This approach initially skips Chapters 6 and 12, the
primary GUI chapters. After studying Chapters 1–5, 7–11, 13, and 14, the reader can
come back to study Chapters 6 and 12, the GUI chapters. Also note that Chapter 14
can be studied after Chapter 9.
If you choose the second approach, it should also be noted that the Programming Examples in
Chapters 8 and 10 are developed first without any GUI components, and then the programs
are extended to incorporate GUI components. Also, if Chapter 6 is skipped, the reader can skip
the event handling part of Chapter 11. Chapter 13 (recursion) contains two Programming
Examples: one creates a non-GUI application program, while the other creates a program that
uses GUI. If you skip Chapters 6 and 12, you can skip the GUI part of the Programming
Examples in Chapters 8, 10, 11, and 13. Once you have studied Chapter 6 and 12, you can
study the GUI part of the Programming Examples of Chapters 8, 10, 11, and 13.

Copyright 2011 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.
Licensed to: iChapters User

Preface to the Fifth Edition | xxiii

Figure 1 shows a chapter dependency diagram for this book. Solid arrows indicate that the
chapter at the beginning of the arrow is required before studying the chapter at the end of the
arrow. A dotted arrow indicates that the chapter at the beginning of the arrow is not essential
to studying the chapter at the end of the dotted arrow.

Chapter 1

Chapter 2

Chapter 3

Chapter 4

Chapter 5

Chapter 6 Chapter 7

Chapter 8 Chapter 9

Chapter 10 Chapter 14

Chapter 11

Chapter 12

Chapter 13

A dotted arrow means that the chapter is not essential to studying the following chapter.

FIGURE 1 Chapter dependency diagram

All source code and solutions have been written, compiled, and quality assurance tested
with Java 6.0 and the version of Java 7.0 available at the time this book was being typeset.

Copyright 2011 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.
Licensed to: iChapters User

FEATURES OF THE BOOK

Four-color
interior design
shows
accurate code
and related
comments.

Copyright 2011 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.
Licensed to: iChapters User

The debugging
sections show
how to find
and correct
syntax and
semantic
(logical)
errors.

Copyright 2011 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.
Licensed to: iChapters User

More than
250 visual
diagrams,
both
extensive and
exhaustive,
illustrate difficult
concepts.

Copyright 2011 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.
Licensed to: iChapters User

Numbered Examples
illustrate the key
concepts with their
relevant code. The
programming code in
these examples is
followed by a Sample
Run. An explanation
then follows that
describes what each
line in the code does.

Copyright 2011 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.
Licensed to: iChapters User

Notes highlight
important facts
about the concepts
introduced in the
chapter.

Copyright 2011 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.
Licensed to: iChapters User

Programming
Examples are
complete programs
featured in each
chapter. These
examples include the
accurate, concrete
stages of Input,
Output, Problem
Analysis and Algorithm
Design, and a
Complete Program
Listing.

Copyright 2011 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.
Licensed to: iChapters User

Exercises further
reinforce learning
and ensure that
students have, in
fact, mastered the
material.

Copyright 2011 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.
Licensed to: iChapters User

Programming
Exercises challenge
students to write
Java programs with
a specified
outcome.

Copyright 2011 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.
Licensed to: iChapters User

Copyright 2011 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.
Licensed to: iChapters User

S UPPLEMENTAL
R ESOURCES

The following supplemental materials are available when this book is used in a classroom setting.
Most instructor teaching tools, outlined below, are available with this book on a single
CD-ROM, and are also available for instructor access at login.cengage.com.

Electronic Instructor’s Manual


The Instructor’s Manual that accompanies this textbook includes:
• Additional instructional material to assist in class preparation, including suggestions
for lecture topics.
• Solutions to all the end-of-chapter materials, including the Programming Exercises.

ExamView!
This textbook is accompanied by ExamView, a powerful testing software package that allows
instructors to create and administer printed, computer (LAN-based), and Internet exams.
ExamView includes hundreds of questions that correspond to the topics covered in this text,
enabling students to generate detailed study guides that include page references for further
review. These computer-based and Internet testing components allow students to take exams
at their computers, and save the instructor time because each exam is graded automatically.

PowerPoint Presentations
Microsoft PowerPoint slides are available for each chapter. These slides are provided as a teaching
aid for classroom presentations, either to make available to students on the network for chapter
review, or to be printed for classroom distribution. Instructors can add their own slides for
additional topics that they introduce to the class.

Distance Learning
Course Technology is proud to present online courses in WebCT and Blackboard to provide
the most complete and dynamic learning experience possible. For more information on how

Copyright 2011 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.
Licensed to: iChapters User

xxxiv | Java Programming: From Problem Analysis to Program Design, Fifth Edition

to bring distance learning to your course, contact your local Course Technology sales
representative.

Source Code
The source code is available for students at www.cengagebrain.com. At the cengagebrain.com home
page, search for the ISBN of your title (from the back cover of your book) using the search
box at the top of the page. This will take you to the product page where these resources can
be found. The source code is also available on the Instructor Resources CD-ROM. The
input files needed to run some of the programs are also included with the source code.

Additional Student Files


The Additional Student Files referenced throughout the text are available on the Instructor
Resources CD. Students can download these files directly at www.cengagebrain.com. At the
cengagebrain.com home page, search for the ISBN of your title using the search box at the top
of the page. This will take you to the product page where these resources can be found. Click
the Access Now link below the book cover to find all study tools and additional files available
directly to students. Additional Student Files appear on the left navigation and provide access
to additional Java programs, selected solutions, and more.

Solution Files
The solution files for all programming exercises are available for instructor download at
http://login.cengage.com and are also available on the Instructor Resources CD-ROM. The
input files needed to run some of the programming exercises are also included with the
solution files.

Copyright 2011 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.
Licensed to: iChapters User

A CKNOWLEDGMENTS

There are many people I must thank who, in one way or another, contributed to the success
of this book. First, I would like to thank those who e-mailed numerous comments that helped
to improve on the fourth edition. I am thankful to Professors S.C. Cheng and Randall Crist
for constantly supporting this project.
I owe a great deal to the following reviewers, who patiently read each page of every chapter
of the current version and made critical comments that helped to improve the book:
Nadimpalli Mahadev, Fitchburg State College and Baoqiang Yan, Missouri Western State
University. Additionally, I would like to thank Brian Candido, Springfield Technical Com-
munity College, for his review of the proposal package. The reviewers will recognize that
their suggestions have not been overlooked and, in fact, made this a better book.
Next, I express thanks to Brandi Shailer, Acquisitions Editor, for recognizing the importance
and uniqueness of this project. All this would not have been possible without the careful
planning of Senior Product Manager Alyssa Pratt. I extend my sincere thanks to Alyssa, as well
as to Content Project Manager, Lisa Weidenfeld. I also thank Sreejith Govindan of Integra
Software Services for assisting us in keeping the project on schedule. I would like to thank
Chris Scriver and Serge Palladino of the MQA department of Course Technology for patiently
and carefully proofreading the text, testing the code, and discovering typos and errors.
I am thankful to my parents for their blessings.
Finally, I am thankful to the support of my wife Sadhana, and especially my daughter Shelly,
to whom this book is dedicated. They cheered me up whenever I was overwhelmed during
the writing of this book.
We welcome any comments concerning the text. Comments may be forwarded to the
following e-mail address: [email protected].
D.S. Malik

Copyright 2011 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.
Licensed to: iChapters User

Copyright 2011 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.
Licensed to: iChapters User

APPENDIX A
J AVA R ESERVED
W ORDS

The following table lists Java reserved words in alphabetical order.


abstract else interface switch
assert enum long synchronized
boolean extends native this
break false new throw
byte final null throws
case finally package transient
catch float private true
char for protected try
class goto public void
const if return volatile
continue implements short while
default import static
do instanceof strictfp
double int super

The reserved words const and goto are not currently in use.

939
Copyright 2011 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.
Licensed to: iChapters User

Copyright 2011 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.
Licensed to: iChapters User

APPENDIX B
O PERATOR
P RECEDENCE

The following table shows the precedence of operators in Java from highest to lowest,
and their associativity.

Operator Description Precedence Level Associativity

. Object member access 1 Left to right


[] Array subscripting 1 Left to right
(parameters) Method call 1 Left to right
++ Postincrement 1 Left to right
-- Postdecrement 1 Left to right

++ Preincrement 2 Right to left


-- Predecrement 2 Right to left
+ Unary plus 2 Right to left
- Unary minus 2 Right to left
! Logical not 2 Right to left
! Bitwise not 2 Right to left

new Object instantiation 3 Right to left


(type) Type conversion 3 Right to left

* Multiplication 4 Left to right


/ Division 4 Left to right
% Remainder (modulus) 4 Left to right

941
Copyright 2011 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.
Licensed to: iChapters User

942 | Appendix B: Operator Precedence

Operator Description Precedence Level Associativity

+ Addition 5 Left to right


- Subtraction 5 Left to right
+ String concatenation 5 Left to right
<< Left shift 6 Left to right
Right shift with sign
>> 6 Left to right
extension
Right shift with zero
>>> 6 Left to right
extension

< Less than 7 Left to right


<¼ Less than or equal to 7 Left to right
> Greater than 7 Left to right
>¼ Greater than or equal to 7 Left to right
instanceof Type comparison 7 Left to right

¼¼ Equal to 8 Left to right


!¼ Not equal to 8 Left to right

& Bitwise AND 9 Left to right


& Logical AND 9 Left to right

^ Bitwise XOR 10 Left to right


^ Logical XOR 10 Left to right

| Bitwise OR 11 Left to right


| Logical OR 11 Left to right

&& Logical AND 12 Left to right

Copyright 2011 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.
Licensed to: iChapters User

Appendix B: Operator Precedence | 943

Operator Description Precedence Level Associativity

|| Logical OR 13 Left to right

?: Conditional operator 14 Right to left

¼ Assignment 15 Right to left


Compound Operators
Addition, then
+¼ 15 Right to left
assignment
String concatenation,
+¼ 15 Right to left
then assignment
Subtraction, then
-¼ 15 Right to left
assignment
Multiplication, then
*¼ 15 Right to left
assignment
Division, then
/¼ 15 Right to left
assignment
Remainder, then
%¼ 15 Right to left
assignment
Bitwise left shift, then
<<¼ 15 Right to left
assignment
Bitwise right shift, then
>>¼ 15 Right to left
assignment
Bitwise unsigned-right
>>>¼ 15 Right to left
shift, then assignment
Bitwise AND, then
&¼ 15 Right to left
assignment
Logical AND, then
&¼ 15 Right to left
assignment
Bitwise OR, then
|¼ 15 Right to left
assignment
Logical OR, then
|¼ 15 Right to left
assignment
Bitwise XOR, then
^¼ 15 Right to left
assignment
Logical XOR, then
^¼ 15 Right to left
assignment

Copyright 2011 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.
Licensed to: iChapters User

Copyright 2011 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.
Licensed to: iChapters User

APPENDIX C
C HARACTER S ETS

This appendix lists and describes the character sets for ASCII (American Standard Code
for Information Interchange), which also comprises the first 128 characters of the Uni-
code character set, and EBCDIC (Extended Binary Coded Decimal Interchange Code).

ASCII (American Standard Code for Information Interchange),


the First 128 Characters of the Unicode Character Set
The following table shows the first 128 characters of the Unicode (ASCII) character set.

ASCII

0 1 2 3 4 5 6 7 8 9
0 nul soh stx etx eot enq ack bel bs ht
1 lf vt ff cr so si dle dc1 dc2 dc3
2 dc4 nak syn etb can em sub esc fs gs
3 rs us b ! " # $ % & '
4 ( ) * + , - . / 0 1
5 2 3 4 5 6 7 8 9 : ;
6 < ¼ > ? @ A B C D E
7 F G H I J K L M N O
8 P Q R S T U V W X Y
9 Z [ \ ] ^ _ ` a b c
10 d e f g h i j k l m
11 n o p q r s t u v w
12 x y z { | } " del

945
Copyright 2011 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.
Another Random Scribd Document
with Unrelated Content
The Project Gutenberg eBook of Azul...
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.

Title: Azul...

Author: Rubén Darío

Illustrator: Enrique Ochoa

Release date: August 25, 2016 [eBook #52894]


Most recently updated: October 23, 2024

Language: Spanish

Credits: Produced by Josep Cols Canals, Chuck Greif and the


Online
Distributed Proofreading Team at http://www.pgdp.net
(This
file was produced from images generously made
available
by The Internet Archive/Canadian Libraries)

*** START OF THE PROJECT GUTENBERG EBOOK AZUL... ***


AZUL...

AL ÍNDICE
A D. Rubén Darío.
Madrid, 22 de Octubre de 1888.

I
ODO libro, que desde América llega a mis manos, excita mi interés
y despierta mi curiosidad; pero ninguno hasta hoy la ha
despertado tan viva como el de usted, no bien comencé a leerlo.
Confieso que al principio, a pesar de la amable dedicatoria con
que usted me envía un ejemplar, miré el libro con indiferencia... casi con
desvío. El título Azul... tuvo la culpa.
Víctor Hugo dice: L’art c’est l’azur; pero yo no me conformo ni me
resigno con que tal dicho sea muy profundo y hermoso. Para mí, tanto vale
decir que el arte es lo azul, como decir que es lo verde, lo amarillo o lo rojo.
¿Por qué, en este caso, lo azul (aunque en francés no sea bleu, sino azur,
que es más poético) ha de ser cifra, símbolo y superior predicamento que
abarque lo ideal, lo etéreo, lo infinito, la serenidad del cielo sin nubes, la luz
difusa, la amplitud vaga y sin límites, donde nacen, viven, brillan y se
mueven los astros? Pero aunque todo esto y más surja del fondo de nuestro
ser y aparezca a los ojos del espíritu, evocado por la palabra azul, ¿qué
novedad hay en decir que el arte es todo esto? Lo mismo es decir que el arte
es imitación de la Naturaleza, como lo definió Aristóteles: la percepción de
todo lo existente y de todo lo posible, y su reaparición o representación por
el hombre en signos, letras, sonidos, colores o líneas. En suma: yo, por más
vueltas que le doy, no veo en eso de que el arte es lo azul sino una frase
enfática y vacía.
Sea, no obstante, el arte azul, o del color que se quiera. Como sea bueno,
el color es lo que menos importa. Lo que a mí me dió mala espina fué la
frase de Víctor Hugo, y el que usted hubiese dado por título a su libro la
palabra fundamental de la frase. ¿Si será éste, me dije, uno de tantos y
tantos como por todas partes, y sobre todo en Portugal y en la América
española, han sido inficionados por Víctor Hugo? La manía de imitarle ha
hecho verdaderos estragos, porque la atrevida juventud exagera sus
defectos, y porque eso que se llama genio, y que hace que los defectos se
perdonen y tal vez se aplaudan, no se imita cuando no se tiene. En
resolución yo sospeché que era usted un Víctor Huguito y estuve más de
una semana sin leer el libro de usted.
No bien le he leído, he formado muy diferente concepto. Usted es usted
con gran fondo de originalidad y de originalidad muy extraña. Si el libro,
impreso en Valparaíso este año de 1888, no estuviese en muy buen
castellano, lo mismo podría ser de un autor francés, que de un italiano, que
de un turco o de un griego. El libro está impregnado de espíritu
cosmopolita. Hasta el nombre y apellido del autor, verdaderos o
contrahechos y fingidos, hacen que el cosmopolitismo resalte más. Rubén
es judaico, y persa es Darío; de suerte que por los nombres no parece sino
que usted quiere ser o es de todos los países, castas y tribus.
El libro Azul... no es en realidad un libro; es un folleto de 132 páginas;
pero tan lleno de cosas y escrito por estilo tan conciso, que da no poco en
qué pensar y tiene bastante que leer. Desde luego se conoce que el autor es
muy joven: que no puede tener más de veinticinco años, pero que los ha
aprovechado maravillosamente. Ha aprendido muchísimo, y en todo lo que
sabe y expresa muestra singular talento artístico y poético.
Sabe con amor la antigua literatura griega; sabe de todo lo moderno
europeo. Se entrevé, aunque no hace gala de ello, que tiene el concepto
cabal del mundo visible y del espíritu humano, tal como este concepto ha
venido a formarse por el conjunto de observaciones, experiencias, hipótesis
y teorías más recientes. Y se entrevé también que todo esto ha penetrado en
la mente del autor, no diré exclusivamente, pero sí principalmente, a través
de libros franceses. Es más: en los perfiles, en los refinamientos, en las
exquisiteces del pensar y del sentir del autor hay tanto de francés, que yo
forjé una historia a mi antojo para explicármela. Supuse que el autor, nacido
en Nicaragua, había ido a París a estudiar para médico o para ingeniero, o
para otra profesión; que en París había vivido seis o siete años, con artistas,
literatos, sabios y mujeres alegres de por allá; y que mucho de lo que sabe
lo había aprendido de viva voz, y empíricamente, con el trato y roce de
aquellas personas. Imposible me parecía que de tal manera se hubiese
impregnado el autor del espíritu parisiense novísimo sin haber vivido en
París durante años.
Extraordinaria ha sido mi sorpresa cuando he sabido que usted, según
me aseguran sujetos bien informados, no ha salido de Nicaragua sino para ir
a Chile en donde reside desde hace dos años a lo más. ¿Cómo, sin el influjo
del medio ambiente, ha podido usted asimilarse todos los elementos del
espíritu francés, si bien conservando española la forma que auna y organiza
estos elementos, convirtiéndolos en substancia propia?
Yo no creo que se ha dado jamás caso parecido con ningún español
peninsular. Todos tenemos un fondo de españolismo que nadie nos arranca
ni a veinticinco tirones. En el famoso abate Marchena, con haber residido
tanto tiempo en Francia, se ve el español; en Cienfuegos es postizo el
sentimentalismo empalagoso a lo Rousseau, y el español está por bajo.
Burgos y Reinoso son afrancesados y no franceses. La cultura de Francia,
buena o mala, no pasa nunca de la superficie. No es más que un barniz
transparente, detrás del cual se descubre la condición española.
Ninguno de los hombres de letras de la Península, que he conocido yo,
con más espíritu cosmopolita, y que más largo tiempo han residido en
Francia y que han hablado mejor el francés y otras lenguas extranjeras, me
ha parecido nunca tan compenetrado del espíritu de Francia como usted me
parece: ni Galiano, ni don Eugenio de Ochoa, ni Miguel de los Santos
Alvarez. En Galiano habla como una mezcla de anglicismo y de filosofismo
francés del siglo pasado; pero todo sobrepuesto y no combinado con el ser
de su espíritu, que era castizo. Ochoa era y siguió siendo siempre archi y
ultraespañol, a pesar de sus entusiasmos por las cosas de Francia. Y en
Alvarez, en cuya mente bullen las ideas de nuestro siglo, y que ha vivido
años en París, está arraigado el ser del hombre de Castilla, y en su prosa
recuerda el lector a Cervantes y a Quevedo, y en sus versos a Garcilaso y a
León, aunque así en versos como en prosa, emita él siempre ideas más
propias de nuestro siglo que de los que pasaron. Su chiste no es el esprit
francés, sino el humor español de las novelas picarescas y de los autores
cómicos de nuestra peculiar literatura.
Veo, pues, que no hay autor en castellano más francés que usted, y lo
digo para afirmar un hecho sin elogio y sin censura. En todo caso, más bien
lo digo como elogio. Yo no quiero que los autores no tengan carácter
nacional; pero yo no puedo exigir de usted que sea nicaragüense, porque ni
hay ni puede haber aún historia literaria, escuela y tradiciones literarias en
Nicaragua. Ni puedo exigir de usted que sea literariamente español, pues ya
no lo es políticamente, y está además separado de la madre patria por el
Atlántico, y más lejos en la república donde ha nacido, de la influencia
española que en otras repúblicas hispanoamericanas. Estando así disculpado
el galicismo de la mente, es fuerza dar a usted alabanzas a manos llenas por
lo perfecto y profundo de ese galicismo; porque el lenguaje persiste
español, legítimo y de buena ley, y porque si no tiene usted carácter
nacional, posee carácter individual.
En mi sentir hay en usted una poderosa individualidad de escritor, ya
bien marcada, y que, si Dios da a usted la salud que yo le deseo y larga
vida, ha de desenvolverse y señalarse más con el tiempo en obras que sean
gloria de las letras hispanoamericanas.
Leídas las 132 páginas de Azul... lo primero que se nota es que está usted
saturado de toda la más flamante literatura francesa: Hugo, Lamartine,
Musset, Baudelaire, Leconte de Lisle, Gautier, Bourget, Sully-Prouhomme,
Daudet, Zola, Barbey d’Aurevilly, Catulle Mendes, Rollinat, Goncourt,
Flaubert y todos los demás poetas y novelistas han sido por usted bien
estudiados y mejor comprendidos. Y usted no imita a ninguno: ni es usted
romántico, ni naturalista, ni neurótico, ni decadente, ni simbólico, ni
parnasiano. Usted lo ha revuelto todo: lo ha puesto a cocer en el alambique
de su cerebro, y ha sacado de ello una rara quinta esencia.
Resulta de aquí un autor nicaragüense, que jamás salió de Nicaragua
sino para ir a Chile, y que es autor tan a la moda de París y con tanto chic y
distinción, que se adelanta a la moda y pudiera modificarla e imponerla.
En el libro hay Cuentos en prosa y seis composiciones en verso. En los
cuentos y en las poesías todo está cincelado, burilado, hecho para que dure,
con primor y esmero, como pudiera haberlo hecho Flaubert, o el parnasiano
más atildado. Y, sin embargo, no se nota el esfuerzo, ni el trabajo de la lima,
ni la fatiga del rebuscar: todo parece espontáneo y fácil y escrito al correr
de la pluma, sin mengua de la concisión, de la precisión y de la extremada
elegancia. Hasta las rarezas extravagantes y salidas de tono, que a mí me
chocan, pero que acaso agraden en general, están hechas adrede. Todo en el
librito está meditado y criticado por el autor, sin que su crítica previa o
simultánea de la creación perjudique al brío apasionado y a la inspiración
del que crea.
Si se me preguntase qué enseña su libro de usted y de qué trata,
respondería yo sin vacilar: no enseña nada, y trata de nada y de todo. Es
obra de artista, obra de pasatiempo, de mera imaginación. ¿Qué enseña o de
qué trata un dije, un camafeo, un esmalte, una pintura o una linda copa
esculpida?
Hay, sin embargo, notable diferencia en toda escultura, pintura, dije y
hasta música, y cualquier objeto de arte cuyo material es la palabra. El
mármol, el bronce y el sonido no diré yo que sutilizando mucho no puedan
significar algo de por sí; pero la palabra, no sólo puede significar, sino que
forzosamente significa ideas, sentimientos, creencias, doctrinas y todo el
pensamiento humano. Nada más factible, a mi ver (acaso porque soy poco
agudo), que una bella estatua, un lindo dije, un cuadro primoroso, sin
transcendencia o sin símbolos; pero ¿cómo escribir un cuento o unas coplas
sin que deje ver el autor lo que niega, lo que afirma, lo que piensa y lo que
siente? El pensamiento en todas las artes pasa con la forma desde la mente
del artista a la substancia o materia del arte; pero en el arte de la palabra,
además del pensamiento que pose el arte en la forma, la substancia o
materia del artista es pensamiento también y pensamiento de artista. La
única materia extraña al artista es el Diccionario, con las reglas
gramaticales que siguen las voces en su combinación; pero como ni
palabras ni combinaciones de palabras pueden darse sin sentido, de aquí
que materia y forma sean en poesía y en prosa creación del escritor o del
poeta: sólo quedan fuera de él, digámoslo así, los signos hueros, o sea
abstrayendo lo significado.
De esta suerte se explica cómo, con ser su libro de usted de pasatiempo,
y sin propósito de enseñar nada, en él se ven patentes las tendencias y los
pensamientos del autor sobre las cuestiones más trascendentales. Y justo es
que confesemos que los dichos pensamientos no son ni muy edificantes ni
muy consoladores.
La ciencia de experiencia y de observación ha clasificado cuanto hay, y
ha hecho de ello hábil inventario. La crítica histórica, la lingüística y el
estudio de las capas que forman la corteza del globo han descubierto
bastante de los pasados hechos humanos que antes se ignoraban; de los
astros que brillan en la extensión del éter se sabe muchísimo; el mundo de
lo imperceptiblemente pequeño se nos ha revelado merced al microscopio;
hemos averiguado cuántos ojos tiene tal insecto y cuántas patitas tiene tal
otro: sabemos ya de qué elementos se componen los tejidos orgánicos, la
sangre de los animales y el jugo de las plantas: nos hemos aprovechado de
agentes que antes se substraían al poder humano, como la electricidad; y
gracias a la estadística, llevamos minuciosa cuenta de cuánto se engendra y
de cuánto se devora; y si ya no se sabe, es de esperar que pronto se sepa la
cifra exacta de los panecillos, del vino y de la carne que se come y se bebe
la humanidad de diario.
No es menester acudir a sabios profundos: cualquier sabio adocenado y
medianejo de nuestra edad conoce hoy, clasifica y ordena los fenómenos
que hieren los sentidos corporales, auxiliados estos sentidos por
instrumentos poderosos que aumentan su capacidad de percepción. Además
se han descubierto, a fuerza de paciencia y de agudeza y por virtud de la
dialéctica y de las matemáticas, gran número de leyes que dichos
fenómenos siguen.
Natural es que el linaje humano se haya ensoberbecido con tamaños
descubrimientos e invenciones; pero, no sólo en torno y fuera de la esfera
de lo conocido y circunscribiéndola, sino también llenándola en lo esencial
y substancial, queda un infinito inexplorado, una densa e impenetrable
obscuridad, que parece más tenebrosa por la misma contraposición de la luz
con que ha bañado la ciencia la pequeña suma de cosas que conoce. Antes,
ya las religiones con sus dogmas, que aceptaba la fe, ya la especulación
metafísica con la gigante máquina de sus brillantes sistemas, encubrían esa
inmensidad incognoscible, o la explicaban y la daban a conocer a su modo.
Hoy priva el empeño de que no haya ni metafísica ni religión. El abismo de
lo incognoscible queda así descubierto y abierto, y nos atrae y nos da
vértigo, y nos comunica el impulso, a veces irresistible, de arrojarnos en él.
La situación, no obstante, no es incómoda para la gente sensata de cierta
ilustración y fuste. Prescinden de lo transcendente y de lo sobrenatural para
no calentarse la cabeza ni perder el tiempo en balde. Esta inclinación les
quita no pocas aprensiones y cierto miedo, aunque a veces les infunde otro
miedo y sobresalto fastidiosos. ¿Cómo contener a la plebe, a los
menesterosos, hambrientos e ignorantes, sin ese freno que ellos han
desechado con tanto placer? Fuera de este miedo que experimentan algunos
sensatos, en todo lo demás no ven sino motivo de satisfacción y parabienes.
Los insensatos, en cambio, no se aquietan con el goce del mundo,
hermoseado por la industria e inventiva humanas, ni con lo que se sabe, ni
con lo que se fabrica, y anhelan averiguar y gozar más.
El conjunto de los seres, el Universo, todo cuanto alcanza a percibir la
vista y el oído, ha sido, como idea, coordinado metódicamente en una
anaquelería o casillero para que se comprenda mejor; pero ni este orden
científico, ni el orden natural, tal como los insensatos le ven, les satisface.
La molicie y el regalo de la vida moderna los han hecho muy
descontentadizos.
Y así ni del mundo tal como es, ni del mundo tal como lo concebimos, se
forman idea muy aventajada. Se ve en todo faltas, y no se dice lo que dicen
que dijo Dios: Que todo era bueno. La gente se lanza con más frecuencia
que nunca a decir que todo es malo; y en vez de atribuir la obra a un artífice
inteligentísimo y supremo, la supone obra de un puritano inconsciente de
fabricar cosas que hay ab eterno en los átomos, los cuales tampoco se sabe
a punto fijo lo que sean.
Los dos resultados principales de todo ello en la literatura de última
moda son:
1.º Que se suprima a Dios o que no se le miente sino para insolentarse
con él, ya con reniegos y maldiciones, ya con burlas y sarcasmos.
Y 2.º Que en este infinito tenebroso e incognoscible perciba la
imaginación, así como en el éter, nebulosas o semilleros de astros,
fragmentos y escombros de religiones muertas, con los cuales procura
formar algo como ensayo de nuevas creencias y de renovadas mitologías.
Estos dos rasgos van impresos en su librito de usted: El pesimismo,
como remate de toda descripción de lo que conocemos, y la poderosa y
lozana producción de seres fantásticos, evocados o sacados de las tinieblas
de lo incognoscible, donde vagan las ruinas de las destrozadas creencias y
supersticiones vetustas.
Ahora será bien que yo cite muestras y pruebe que hay en su libro de
usted, con notable elegancia, todo lo que afirmo; pero esto requiere segunda
carta.

II
En la cubierta del libro que me ha enviado usted veo que ha publicado
usted ya, o anuncia la publicación de otros varios, cuyos títulos son:
Epístolas y poemas, Rimas, Abrojos, Estudios críticos, Albumes y abanicos,
Mis conocidos y Dos años en Chile. Anuncia también dicha cubierta que
prepara usted una novela, cuyo título nos da en las narices del alma (pues si
hay ojos del alma o tiene el alma ojos, bien puede tener narices) con un
tufillo a pornografía. La novela se titula: La carne.
Nada de esto, con todo, me sirve hoy para juzgar a usted, pues yo nada
de esto conozco. Tengo que contraerme al libro Azul.
En este libro no sé qué debo preferir: si la prosa o los versos. Casi me
inclino a ver mérito igual en ambos modos de expresión del pensamiento de
usted. En la prosa hay más riqueza de ideas; pero es más afrancesada la
forma. En los versos la forma es más castiza. Los versos de usted se
parecen a los versos españoles de otros autores, y no por eso dejan de ser
originales; no recuerdan a ningún poeta español, ni antiguo, ni de nuestros
días.
El sentimiento de la Naturaleza raya en usted en adoración panteística.
Hay en las cuatro composiciones a (a o más bien en) las cuatro estaciones
del año, la más gentílica exuberancia de amor sensual, y, en este amor, algo
de religioso.
Cada composición parece un himno sagrado a Eros, himno que, a las
veces, en la mayor explosión de entusiasmo, el pesimismo viene a turbar
con la disonancia, ya de un ay de dolor, ya de una carcajada sarcástica.
Aquel sabor amargo, que brota del centro mismo de todo deleite, y que tan
bien experimentó y expresó el ateo Lucrecio,

...medio de frute leporum


Surgit amari aliquid, quod im ipsis floribus angat

acude a menudo a interrumpir lo que usted llama

«La música triunfante de mis rimas.»

Pero, como en usted hay de todo, noto en los versos, además del ansia
del deleite y además de la amargura de que habla Lucrecio, la sed de lo
eterno, esa aspiración profunda e insaciable de las edades cristianas, que el
poeta pagano quizá no hubiera comprendido.
Usted pide siempre más al hada, y...
«El hada entonces me llevó hasta el velo
que nos cubre las ansias infinitas,
la inspiración profunda
y el alma de las liras.
Y lo rasgó. Y allí todo era aurora.»

Pero aun así, no se satisface el poeta, y pide más al hada.


Tiene usted otra composición, la que lleva por título la palabra griega
Anagke, donde el cántico de amor acaba en un infortunio y en una
blasfemia. Suprimiendo la blasfemia final, que es burla contra Dios, voy a
poner aquí el cántico casi completo.
«Y dijo la paloma:
—Yo soy feliz. Bajo el inmenso cielo,
en el árbol en flor, junto a la Poma
llena de miel, junto al retoño suave
y húmedo por las gotas de rocío,
tengo mi hogar. Y vuelo
con mis anhelos de ave,
del amado árbol mío
hasta el bosque lejano,
cuando al himno jocundo
del despertar de Oriente,
sale el alba desnuda y muestra al mundo
el pudor de la luz sobre su frente.
Mi ala es blanca y sedosa;
la luz la dora y baña
y céfiro la peina
son mis pies como pétalos de rosa.
Yo soy la dulce reina
que arrulla a su palomo en la montaña.
En el fondo del bosque pintoresco
está el alerce en que formé mi nido;
y tengo allí bajo el follaje fresco
un polluelo sin par, recién nacido.
Soy la promesa alada,
el juramento vivo;
soy quien lleva el recuerdo de la amada
para el enamorado pensativo;
yo soy la mensajera
de los tristes y ardientes soñadores,
que va a revolotear diciendo amores
junto a una perfumada cabellera.
Soy el lirio del viento.
Bajo el azul del hondo firmamento
muestro de mi tesoro bello y rico
las preseas y galas:
el arrullo en el pico,
la caricia en las alas
la caricia en las alas.
Yo despierto a los pájaros parleros
y entonan sus melódicos cantares;
me poso en los floridos limoneros
y derramo una lluvia de azahares.
Yo soy toda inocente, toda pura.
Yo me esponjo en las alas del deseo.
Y me estremezco en la íntima ternura
de un roce, de un rumor, de un aleteo.
¡Oh inmenso azul! Yo te amo. Porque a Flora
das la lluvia y el sol siempre encendido:
porque siendo el palacio de la aurora,
también eres el techo de mi nido.
¡Oh inmenso azul! Yo adoro
tus celajes risueños,
y esa niebla sutil de polvo de oro
donde van los perfumes y los sueños.
Amo los velos, tenues, vagarosos,
de las flotantes brumas,
donde tiendo a los aires cariñosos
el sedeño abanico de mis plumas.
¡Soy feliz! Porque es mía la floresta
donde el misterio de los aires se halla;
porque el alba es mi fiesta
y el amor mi ejercicio y mi batalla.
Feliz, porque de dulces ansias llena,
calentar mis polluelos es mi orgullo;
porque en las selvas vírgenes resuena
la música celeste de mi arrullo;
porque no hay una rosa que no me ame,
ni pájaro gentil que no me escuche,
ni garrido cantor que no me llame!
—¿Sí?—dijo entonces un gavilán infame,
y con furor se la metió en el buche.»

Suprimo, como dije ya, los versos que siguen y que no pasan de ocho,
donde se habla de la risa que le dió a Satanás de resultas del lance y de lo
pensativo que se quedó el Señor en su trono.
Entre las cuatro composiciones en las estaciones del año, todas bellas y
raras, sobresale la del verano. Es un cuadro simbólico de los dos polos
sobre los que rueda el eje de la vida: el amor y la lucha; el prurito de
destrucción y el de reproducción. La tigre virgen en celo está
magistralmente pintada, y mejor aún acaso el tigre galán y robusto que llega
y la enamora.

«Al caminar se veía


su cuerpo ondear con garbo y bizarría.
Se miraban los músculos hinchados
debajo de la piel. Y se diría
ser aquella alimaña
un rudo gladiador de la montaña.

Los pelos erizados


del labio relamía. Cuando andaba
con su peso chafaba
la yerva verde y muelle,
y el ruido de su aliento semejaba
el resollar de un fuelle.»

Síguense la declaración de amor, el sí en lenguaje de tigres, y los


primeros halagos y caricias. Después... el amor en su plenitud, sin los poco
decentes pormenores en que entran Rollinat y otros en casos semejantes.

«Después el misterioso
tacto, las impulsivas
fuerzas que arrastran con poder pasmoso,
y ¡oh gran Pan! el idilio monstruoso
bajo las vastas selvas primitivas.»

El príncipe de Gales, que andaba de caza por allí con gran séquito de
monteros y jauría de perros, viene a poner trágico fin al idilio.
El príncipe mata a la tigre de un escopetazo. El tigre se salva, y luego en
su gruta tiene un extraño sueño:
«Que enterraba las garras y los dientes
en vientres sonrosados
y pechos de mujer; y que engullía
por postres delicados
de comidas y cenas,
como tigre goloso entre golosos,
unas cuantas docenas
de niños tiernos, rubios y sabrosos.»

No parece sino que, en sentir del poeta, tendría menos culpa el tigre,
aunque fuese ser responsable, devorando mujeres y niños, que el príncipe
matando tigres. El afecto del poeta se extiende casi por igual sobre tigres y
sobre príncipes, a quienes un determinismo fatal mueve a matarse
recíprocamente, como el ratón y el gato de la fábula de Alvarez.
Los cuentos en prosa son más singulares aún. Parecen escritos en París,
y no en Nicaragua ni en Chile. Todos son brevísimos. Usted hace gala de
laconismo. La Ninfa es quizá el que más me gusta. La cena en la quinta de
la cortesana está bien descrita. El discurso del sabio prepara el ánimo del
lector. Los límites, que tal vez no existan, pero que todos imaginamos,
trazamos y ponemos entre lo natural y sobrenatural, se esfuman y
desaparecen. San Antonio vió en el yermo un hipocentauro y un sátiro.
Alberto Magno habla también de sátiros que hubo en su tiempo. ¿Por qué
ha de ser esto falso? ¿Por qué no ha de haber sátiros, faunos y ninfas? La
cortesana anhela ver un sátiro vivo; el poeta, una ninfa. La aparición de la
ninfa desnuda al poeta, en el parque de la quinta, a la mañana siguiente, en
la umbría apartada y silenciosa, entre los blancos cisnes del estanque, está
pintada con tal arte que parece verdad.
La ninfa huye y queda burlado el poeta; pero en el almuerzo, dice luego
la cortesana:
«—El poeta ha visto ninfas.»
«Todos la contemplaron asombrados, y ella me miraba como una gata, y
se reía, se reía como una chicuela a quien se le hiciesen cosquillas.»
El velo de la reina Mab es precioso. Empieza así:
«La reina Mab, en su carro hecho de una sola perla tirado por cuatro
coleópteros de petos dorados y alas de pedrería, caminando sobre un rayo
de sol, se coló un día por la ventana de una boardilla, donde estaban cuatro
hombres flacos, barbudos e impertinentes, lamentándose como unos
desdichados.»
Eran un pintor, un escultor, un músico y un poeta. Cada cual hace su
lastimoso discurso, exponiendo aspiraciones y desengaños. Todos terminan
en la desesperación.
«Entonces la reina Mab, del fondo de su carro, hecho de una sola perla,
tomó un velo azul, casi impalpable, como formado de suspiros o miradas de
ángeles rubios y pensativos. Y aquel velo era el velo de los sueños, de los
dulces sueños que hacen ver la vida de color de rosa. Y con él envolvió a
los cuatro hombres flacos, barbudos e impertinentes. Los cuales cesaron de
estar tristes, porque penetró en ellos la esperanza, y en su cabeza el sol
alegre, con el diablillo de la vanidad, que consuela en sus profundas
decepciones a los pobres artistas.»
Hay en el libro otros varios cuentos, delicados y graciosos, donde se
notan las mismas calidades. Todos estos cuentos parecen escritos en París.
Voy a terminar hablando de los más transcendentales: El rubí y la
canción del oro. El químico Fremy ha descubierto, o se jacta de haber
descubierto, la manera de hacer rubíes. Uno de los gnomos roba uno de esos
rubíes artificiales del medallón que pende del cuello de cierta cortesana, y le
lleva a la extensa y profunda caverna donde los gnomos se reúnen en
conciliábulo. Las fuerzas vivas y creadoras de la Naturaleza, la infatigable
inexhausta fecundidad del alma tierra, están simbolizadas en aquellos
activos y poderosos enanillos que se burlan del sabio y demuestran la
falsedad de su obra. «La piedra es falsa, dicen todos: obra de hombre, o de
sabio, que es peor.»
Luego cuenta el gnomo más viejo la creación del verdadero primer rubí.
Es un hermoso mito, que redunda en alabanza de Amor y de la madre
Tierra, «de cuyo vientre moreno brota la savia de los troncos robustos, y el
oro y el agua diamantina y la casta flor de lis: lo puro, lo fuerte, lo
infalsificable. Y los gnomos tejen una danza frenética y celebran una orgía
sagrada, ensalzando a la mujer, de quien suelen enamorarse, porque es
espíritu de carne: toda amor.»
La canción del oro, sería el mejor de los cuentos de usted si fuera
cuento, y sería el más elocuente de todos si no emplease en él demasiado
una ficelle, de que se usa y de que se abusa muchísimo en el día.
En la calle de los palacios, donde todo es esplendor y opulencia, donde
se ven llegar a sus moradas, de vuelta de festines y bailes, a las hermosas
mujeres y a los hombres ricos, hay un mendigo extraño, hambriento,
tiritando de frío, mal cubierto de harapos. Este mendigo tira un mordisco a
un pequeño mendrugo de pan bazo: se inspira y canta la canción del oro.
Todo el sarcasmo, todo el furor, toda la codicia, todo el amor desdeñado,
todos los amargos celos, toda la envidia que el oro engendra en los
corazones de los hambrientos, de los menesterosos y de los descamisados y
perdidos, están expresados en aquel himno en prosa.
Por esto afirmo que sería admirable la canción del oro si se viese menos
la ficelle: el método o traza de la composición, que tanto siguen ahora los
prosistas, los poetas y los oradores.
El método es crear algo por superposición o aglutinación, y no por
organismo.
El símil es la base de este método. Sencillo es no mentar nada sin símil;
todo es como algo. Luego se ha visto que salen de esta manera muchísimos
comos, y en vez de los comos se han empleado los eses y las esas. Ejemplo:
la tierra: esa madre fecunda de todos los vivientes; el aire, ese manto azul
que envuelve el seno de la tierra, y cuyos flecos son las nubes; el cielo, ese
campo sin límites por donde giran las estrellas, etcétera. De este modo es
fácil llenar mucho papel. A veces los eses y las esas se suprimen, aunque es
menos enfático y menos francés, y sólo se dice el pájaro, flor del aire; la
luna, lámpara nocturna, hostia que se eleva en el templo del espacio, etc.
Y por último, para dar al discurso más animación y movimiento, se ha
discurrido hacer enumeración de todo aquello que se semeja en algo al
objeto de que queremos hablar. Y terminada la enumeración, o cansado el
autor de enumerar, pues no hay otra razón para que termine, dice: eso soy
yo; eso es la poesía; eso es la crítica; eso es la mujer, etc. Puede también el
autor, para prestar mayor variedad y complicación a su obra, decir lo que no
es el objeto que describe antes de decir lo que es. Y puede decir lo que no es
como quien pregunta. Fórmula: ¿Será esto, será aquello, será lo de más
allá? No; no es nada de eso. Luego... la retahila de cosas que se ocurran. Y
por remate: eso es.
Este género de retórica es natural, y todos la empleamos. No se critica
aquí el uso, sino el abuso. En el abuso hay algo parecido al juego infantil de
apurar una letra. «Ha venido un barco cargado de...» Y se va diciendo (si, v.
gr., la letra es b) de baños, de buzos, de bolos, de berros, de bromas.
Las composiciones escritas según este método retórico tienen la ventaja
de que se pueden acortar y alargar ad libitum, y de que se pueden leer al
revés lo mismo que al derecho, sin que a penas varíe el sentido.
En mis peregrinaciones por países extranjeros, y harto lejos de aquí,
conocí yo y traté a una señora muy entendida, cuyo marido era poeta; y ella
había descubierto en los versos de su marido que todos se leían y hacían
sentido empezando por el último verso y acabando por el primero. Querían
decir algunos maldicientes que ella había hecho el descubrimiento para
burlarse de los versos de la cosecha de casa; pero yo siempre tuve por
seguro que ella, cegada por el amor conyugal, ponía en este sentido
indestructible, léanse las composiciones como quiera que se lean, un primor
raro que realzaba el mérito de ellas.
Me ha corroborado en esta opinión un reciente escrito de don Adolfo de
Castro, quien descubre y aplaude en algunos versos de Santa Teresa, casi
como don celeste o gracia divina, esa prenda de que se lean al revés y al
derecho, resultando idéntico sentido.
La verdad del caso, considerado y ponderado todo con imparcial
circunspección, es que tal modo retórico es ridículo cuando se toma por
muletilla, o sirve de pauta para escribir; pero si es espontáneo, está muy
bien: es el lenguaje propio de la pasión.
Figurémonos a una madre, joven, linda y apasionada, con un niño rubito
y gordito y sonrosado, de dos años, que está en sus brazos. Mientras ella le
brinca y él le sonríe, ella le dirá natural y sencillamente interminable lista
de nombres, de objetos, algunos de ellos disparatados. Le llamará ángel,
diablillo, mono, gatito, chuchumeco, corazón, alma, vida, hechizo, regalo,
rey, príncipe y mil cosas más. Y todo estará bien, y nos parecerá encantador,
sea el que sea el orden en que se ponga. Pues lo mismo puede ser toda
composición, en prosa o en verso, por el estilo con tal que no sea buscado ni
frecuente este modo de componer.
El modelo más egregio del género, el ejemplar arquetipo, es la letanía.
La virgen es puerta del cielo, estrella de la mañana, torre de David, arca de
la alianza, casa de oro, y mil cosas más en el orden que se nos antoje
decirlas.
La canción del oro es así: es una letanía, sólo que es infernal en vez de
ser célica. Es por el gusto de la letanía que Baudelaire compuso al demonio;
pero, conviniendo ya en que La canción del oro es letanía, y letanía
infernal, yo me complazco en sostener que es de las más poéticas, ricas y
enérgicas que he leído. Aquello es un diluvio de imágenes, un desfilar
tumultuoso de cuanto hay, para que encomie el oro y predique sus
excelencias.
Citar algo es destruir el efecto que está en la abundancia de cosas que en
desorden se citan y acuden a cantar el oro, «misterioso y callado en las
entrañas de la tierra, y bullicioso cuando brota a pleno sol y a toda vida;
sonante como coro de tímpanos, feto de astros, residuo de luz, encarnación
de éter; hecho de sol, se enamora de la noche, y, al darle el último beso,
riega su túnica con estrellas como con gran muchedumbre de libras
esterlinas. Despreciado por Jerónimo, arrojado por Antonio, vilipendiado
por Macario, humillado por Hilarión, es carne de ídolo, dios becerro, tela de
que Fidias hace el traje de Minerva. De él son las cuerdas de la lira, las
cabelleras de las más tiernas amadas, los granos de la espiga, y el peplo que
al levantarse viste la olímpica aurora.»
Me había propuesto no citar nada, y he citado algo, aunque poco. La
composición es una letanía inorgánica, y, sin embargo, ni la ironía, ni el
amor y el odio, ni el deseo y el desprecio simultáneos que el oro inspira al
poeta en la inopia (achaque crónico y epidémico de los poetas), resaltan
bien sino de la plenitud de cosas que dice del oro, y que se suprimen aquí
por amor a la brevedad.
En resolución, su librito de usted, titulado Azul... nos revela en usted a
un prosista y a un poeta de talento.
Con el galicismo mental de usted no he sido sólo indulgente, sino que le
he aplaudido por lo perfecto. Con todo, yo aplaudiría muchísimo más, si
con esa ilustración francesa que en usted hay, se combinasen la inglesa, la
alemana, la italiana, y ¿por qué no la española también? Al cabo el árbol de
nuestra ciencia no ha envejecido tanto que aun no pueda prestar jugo, ni sus
ramas son tan cortas ni están tan secas que no puedan retoñar como
mugrones del otro lado del Atlántico. De todos modos, con la superior
riqueza y con la mayor variedad de elementos, saldría de su cerebro de
usted algo menos exclusivo y con más altos, puros y serenos ideales: algo
más azul que el azul de su libro de usted; algo que tirase menos a lo verde y
a lo negro. Y por cima de todo, se mostrarían más claras y más marcadas la
originalidad de usted y su individualidad de escritor.
Juan Valera
(De la Real Academia Española).

y se quedó muerto, pensando en


que nacería el sol del día venidero,
y con él el ideal...
EL REY BURGUÉS

(CANTO ALEGRE)

MIGO! el cielo está opaco, el aire frío, el día triste. Un cuento


alegre.., así como para distraer las hermosas y grises melancolías,
helo aquí:
* * *
Había en una ciudad inmensa y brillante un rey muy poderoso, que tenía
trajes caprichosos y ricos, esclavas desnudas, blancas y negras, caballos de
largas crines, armas flamantísimas, galgos rápidos y monteros con cuernos
de bronce, que llenaban el viento con sus fanfarrias. ¿Era un rey poeta? No,
amigo mío: era el Rey Burgués.
* * *
Era muy aficionado a las artes el soberano, y favorecía con gran largueza
a sus músicos, a sus hacedores de ditirambos, pintores, escultores,
boticarios, barberos y maestros de esgrima.
Cuando iba a la floresta, junto al corzo o jabalí herido y sangriento, hacía
improvisar a sus profesores de retórica canciones alusivas; los criados
llenaban las copas de vino de oro que hierve, y las mujeres batían palmas
con movimientos rítmicos y gallardos. Era un rey sol, en su Babilonia llena
de músicas, de carcajadas y de ruido de festín. Cuando se hastiaba de la
ciudad bullente, iba de caza atronando el bosque con sus tropeles; y hacía
salir de sus nidos a las aves asustadas, y el vocerío repercutía en lo más
escondido de las cavernas. Los perros de patas elásticas iban rompiendo la
maleza en la carrera, y los cazadores, inclinados sobre el pescuezo de los
caballos, hacían ondear los mantos purpúreos y llevaban las caras
encendidas y las cabelleras al viento.
* * *
El rey tenía un palacio soberbio donde había acumulado riquezas y
objetos de arte maravillosos. Llegaba a él por entre grupos de lilas y
extensos estanques, siendo saludado por los cisnes de cuellos blancos, antes
que por los lacayos estirados. Buen gusto. Subía por una escalera llena de
columnas de alabastro y de esmaragdina, que tenía a los lados leones de
mármol, como los de los troncos salomónicos. Refinamiento. A más de los
cisnes, tenía una vasta pajarera, como amante de la armonía, del arrullo, del
trino; y cerca de ella iba a ensanchar su espíritu, leyendo novelas de M.
Ohnet, o bellos libros sobre cuestiones gramaticales, o críticas
hermosillescas. Eso sí: defensor acérrimo de la corrección académica en
letras, y del modo lamido en artes; alma sublime amante de la lija y de la
ortografía.
* * *
¡Japonerías! ¡Chinerías! por lujo y nada más.
Bien podía darse el placer de un salón digno del gusto de un Goncourt y
de los millones de un Creso: quimeras de bronce con las fauces abiertas y
las colas enroscadas, en grupos fantásticos y maravillosos; lacas de Kioto
con incrustaciones de hojas y ramas de una flora monstruosa, y animales de
una fauna desconocida; mariposas de raros abanicos junto a las paredes,
peces y gallos de colores; máscaras de gestos infernales y con ojos como si
fuesen vivos; partesanas de hojas antiquísimas y empuñaduras con dragones
devorando flores de loto; y en conchas de huevo, túnicas de seda amarilla,
como tejidas con hilos de araña, sembrada de garzas rojas y de verdes matas
de arroz; y tibores, porcelanas de muchos siglos, de aquellas en que hay
guerreros tártaros con una piel que les cubre hasta los riñones, y que llevan
arcos estirados y manojos de flechas.
Por lo demás, había el salón griego, lleno de mármoles: diosas, musas,
ninfas y sátiros; el salón de los tiempos galantes, con cuadros del gran
Watteau y de Chardin; dos, tres, cuatro, ¡cuántos salones!
Y Mecenas se paseaba por todos, con la cara inundada de cierta
majestad, el vientre feliz y la corona en la cabeza, como un rey de naipe.
* * *
Un día le llevaron una rara especie de hombre ante su trono, donde se
hallaba rodeado de cortesanos, de retóricos y de maestros de equitación y de
baile.
—¿Qué es eso?—preguntó.
—Señor, es un poeta.
El rey tenía cisnes en el estanque, canarios, gorriones, senzontes en la
pajarera: un poeta era algo nuevo y extraño.
—Dejadle aquí.
Y el poeta:
—Señor, no he comido.
Y el rey:
—Habla y comerás.
Comenzó:
* * *
Señor, ha tiempo que yo canto el verbo del porvenir. He tendido mis alas
al huracán, he nacido en el tiempo de la aurora: busco la raza escogida que
debe esperar, con el himno en la boca y la lira en la mano, la salida del gran
sol. He abandonado la inspiración de la ciudad malsana, la alcoba llena de
perfumes, la musa de carne que llena el alma de pequeñez y el rostro de
polvos de arroz. He roto el arpa adulona de las cuerdas débiles, contra las
copas de Bohemia y las jarras donde espumea el vino que embriaga sin dar
fortaleza; he arrojado el manto que me hacía parecer histrión, o mujer, y he
vestido de modo salvaje y espléndido: mi harapo es de púrpura. He ido a la
selva donde he quedado vigoroso y ahito de leche fecunda y licor de nueva
vida; y en la ribera del mar áspero, sacudiendo la cabeza bajo la fuerte y
negra tempestad, como un ángel soberbio, o como un semidiós olímpico, he
ensayado el yambo dando al olvido el madrigal.
He acariciado a la gran Naturaleza, y he buscado el calor del ideal, el
verso que está en el astro en el fondo del cielo, y el que está en la perla en
lo profundo del Océano. ¡He querido ser pujante! Porque viene el tiempo de
las grandes revoluciones, con un Mesías todo luz, todo agitación y potencia,
y es preciso recibir su espíritu con el poema que sea arco triunfal, de
estrofas de acero, de estrofas de oro, de estrofas de amor.
¡Señor, el arte no está en los fríos envoltorios de mármol, ni en los
cuadros lamidos, ni en el excelente señor Ohnet! ¡Señor! el arte no viste
pantalones, ni habla en burgués, ni pone los puntos en todas las íes. Él es
augusto, tiene mantos de oro, o de llamas, o anda desnudo, y amasa la greda
con fiebre, y pinta con luz, y es opulento, y da golpes de ala como las
águilas o zarpazos como los leones. Señor, entre un Apolo y un ganso,
preferid el Apolo, aunque el uno sea de tierra cocida y el otro de marfil.
¡Oh, la poesía!
¡Y bien! Los ritmos se prostituyen, se cantan los lunares de las mujeres y
se fabrican jarabes poéticos. Además, señor, el zapatero critica mis
endecasilabos, y el señor profesor de farmacia pone puntos y comas a mi
inspiración. Señor, ¡y vos lo autorizáis todo esto...! El ideal, el ideal...
El rey interrumpió:
—Ya habéis oído. ¿Qué hacer?
Y un filósofo al uso:
—Si lo permitís, señor, puede ganarse la comida con una caja de música;
podemos colocarle en el jardín, cerca de los cisnes, para cuando os paseéis.
—Sí—dijo el rey; y dirigiéndose al poeta:—Daréis vueltas a un
manubrio: Cerraréis la boca. Haréis sonar una caja de música que toca
valses, cuadrillas y galopas, como no prefiráis moriros de hambre. Pieza de
música por pedazo de pan. Nada de jerigonzas, ni de ideales. Id.
Y desde aquel día pudo verse a la orilla del estanque de los cisnes, al
poeta hambriento que daba vueltas al manubrio; tiririrín, tiririrín...
¡avergonzado a las miradas del gran sol! ¿Pasaba el rey por las cercanías?
¡Tiririrín, tiririrín...! ¿Había que llenar el estómago? ¡Tiririrín! Todo entre
las burlas de los pájaros libres que llegaban a beber rocío en las lilas
floridas; entre el zumbido de las abejas que le picaban el rostro y le
llenaban los ojos de lágrimas... ¡lágrimas amargas que rodaban por sus
mejillas y que caían a la tierra negra!
Y llegó el invierno, y el pobre sintió frío en el cuerpo y en el alma. Y su
cerebro estaba como petrificado, y los grandes himnos estaban en el olvido,
y el poeta de la montaña coronada de águilas, no era sino un pobre diablo
que daba vueltas al manubrio: tiririrín.
Y cuando cayó la nieve se olvidaron de él el rey y sus vasallos; a los
pájaros se les abrigó, y a él se le dejó el aire glacial que le mordía las carnes
y le azotaba el rostro.
Y una noche en que caía de lo alto la lluvia blanca de plumillas
cristalizadas, en el palacio había festín, y la luz de las arañas reía alegre
sobre los mármoles, sobre el oro y sobre las túnicas de los mandarines de
las viejas porcelanas. Y se aplaudían hasta la locura los brindis del señor
profesor de retórica, cuajados de dáctilos, de anapestos y de pirriquios,
mientras en las copas cristalinas hervía el champaña con su burbujeo
luminoso y fugaz. ¡Noche de invierno, noche de fiesta! Y el infeliz, cubierto
de nieve, cerca del estanque, daba vueltas al manubrio para calentarse,
tembloroso y aterido, insultado por el cierzo, bajo la blancura implacable y
helada, en la noche sombría, haciendo resonar entre los árboles sin hojas la
música loca de las galopas y cuadrillas; y se quedó muerto, pensando en
que nacería el sol del día venidero, y con él el ideal... y en que el arte no
vestiría pantalones sino manto de llamas o de oro... Hasta que al día
siguiente lo hallaron el rey y sus cortesanos, al pobre diablo de poeta, como
gorrión que mata el hielo, con una sonrisa amarga en los labios, y todavía
con la mano en el manubrio.
* * *
¡Oh, mi amigo! el cielo está opaco, el aire frío, el día triste. Flotan
brumosas y grises melancolías...
Pero ¡cuánto calienta el alma una frase, un apretón de manos a tiempo!
Hasta la vista.

Cantó los senos de nieve tibia


y las copas de oro labrado, y el
buche del pájaro y la gloria del sol.
EL SÁTIRO SORDO

(CUENTO GRIEGO)

ABITABA cerca del Olimpo un sátiro, y era el viejo rey de su selva.


Los dioses le habían dicho: «Goza, el bosque es tuyo; sé un feliz
bribón, persigue ninfas y suena tu flauta». El sátiro se divertía.
* * *
Un día que el padre Apolo estaba tañendo la divina lira, el sátiro salió de
sus dominios y fué osado a subir el sacro monte y sorprender al dios
crinado. Éste le castigó tornándole sordo como una roca. En balde de las
espesuras de la selva llena de pájaros, se derramaban los trinos y emergían
los arrullos. El sátiro no oía nada. Filomela llegaba a cantarle sobre su
cabeza enmarañada y coronada de pámpanos, canciones que hacían
detenerse los arroyos, y enrojecerse las rosas pálidas. Él permanecía
impasible, o lanzaba sus carcajadas salvajes y saltaba lascivo y alegre
cuando percibía por el ramaje lleno de brechas alguna cadera blanca y
rotunda que acariciaba el sol con su luz rubia. Todos los animales le
rodeaban como a un amo a quien se obedece.
A su vista, para distraerle, danzaban coros de bacantes encendidas en su
fiebre loca, y acompañaban la armonía, cerca de él, faunos adolescentes,
como hermosos efebos, que le acariciaban reverentemente con su sonrisa; y
aunque no escuchaba ninguna voz, ni el ruido de los clótalos, gozaba de
distintas maneras. Así pasaba la vida este rey barbudo, que tenía patas de
cabra.
* * *
Era sátiro caprichoso.
Tenía dos consejeros áulicos: una alondra y un asno. La primera perdió
su prestigio cuando el sátiro se volvió sordo. Antes, si cansado de su
lascivia soplaba su flauta dulcemente, la alondra le acompañaba.
Después en su gran bosque, donde no oía ni la voz del olímpico trueno,
el paciente animal de las largas orejas le servía para cabalgar, en tanto que
la alondra, en los apogeos del alba, se le iba de las manos, cantando camino
de los cielos.
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!

ebookultra.com

You might also like