Full OCA Java SE 7 Programmer I Certification Guide Prepare For The 1Z0 803 Exam 1st Edition Mala Gupta PDF All Chapters
Full OCA Java SE 7 Programmer I Certification Guide Prepare For The 1Z0 803 Exam 1st Edition Mala Gupta PDF All Chapters
com
https://ebookfinal.com/download/oca-java-se-7-programmer-i-
certification-guide-prepare-for-the-1z0-803-exam-1st-
edition-mala-gupta/
OR CLICK BUTTON
DOWNLOAD EBOOK
https://ebookfinal.com/download/oca-ocp-java-se-7-programmer-i-ii-
study-guide-exams-1z0-803-1z0-804-1st-edition-kathy-sierra/
ebookfinal.com
https://ebookfinal.com/download/ccnp-route-642-902-official-
certification-guide-exam-certification-guide-wendell-odom/
ebookfinal.com
https://ebookfinal.com/download/ccnp-switch-642-813-official-
certification-guide-exam-certification-guide-1st-edition-david-hucaby/
ebookfinal.com
Java EE 6 Pocket Guide 1st Edition Arun Gupta
https://ebookfinal.com/download/java-ee-6-pocket-guide-1st-edition-
arun-gupta/
ebookfinal.com
https://ebookfinal.com/download/ccna-icnd2-official-exam-
certification-guide-wendell-odom/
ebookfinal.com
https://ebookfinal.com/download/the-pmp-certification-exam-study-
guide-rosaldo-de-jesus-nocera/
ebookfinal.com
https://ebookfinal.com/download/ccnp-bcmsn-exam-certification-
guide-2nd-edition-david-hucaby/
ebookfinal.com
https://ebookfinal.com/download/java-2-certification-training-
guide-2nd-edition-jamie-jaworski/
ebookfinal.com
Prepare for the 1ZO-803 exam
Mala Gupta
FOREWORD BY Jeanne Boyarsky
MANNING
www.it-ebooks.info
OCA Java SE 7 Programmer I
Certification Guide
www.it-ebooks.info
www.it-ebooks.info
OCA Java SE 7
Programmer I
Certification Guide
PREPARE FOR THE 1Z0-803 EXAM
MALA GUPTA
MANNING
SHELTER ISLAND
www.it-ebooks.info
For online information and ordering of this and other Manning books, please visit
www.manning.com. The publisher offers discounts on this book when ordered in quantity.
For more information, please contact
Special Sales Department
Manning Publications Co.
20 Baldwin Road
PO Box 261
Shelter Island, NY 11964
Email: [email protected]
Many of the designations used by manufacturers and sellers to distinguish their products are
claimed as trademarks. Where those designations appear in the book, and Manning
Publications was aware of a trademark claim, the designations have been printed in initial caps
or all caps.
Recognizing the importance of preserving what has been written, it is Manning’s policy to have
the books we publish printed on acid-free paper, and we exert our best efforts to that end.
Recognizing also our responsibility to conserve the resources of our planet, Manning books
are printed on paper that is at least 15 percent recycled and processed without the use of
elemental chlorine.
ISBN: 9781617291043
Printed in the United States of America
1 2 3 4 5 6 7 8 9 10 – MAL – 19 18 17 16 15 14 13
www.it-ebooks.info
To my pillar of strength, my best friend,
and my husband, Dheeraj Prakash
www.it-ebooks.info
www.it-ebooks.info
brief contents
Introduction 1
1 ■ Java basics 13
2 ■ Working with Java data types 69
3 ■ Methods and encapsulation 110
4 ■ String, StringBuilder, Arrays, and ArrayList 174
5 ■ Flow control 243
6 ■ Working with inheritance 295
7 ■ Exception handling 348
8 ■ Full mock exam 405
vii
www.it-ebooks.info
www.it-ebooks.info
contents
foreword xvii
preface xix
acknowledgments xxi
about this book xxiii
about the author xxx
about the cover illustration xxxi
Introduction 1
1 Disclaimer 2
2 Introduction to OCA Java SE 7 Programmer
certification 2
The importance of OCA Java SE 7 Programmer certification 2
Comparing OCA Java exam versions 3 Comparing the OCA
■
ix
www.it-ebooks.info
x CONTENTS
1 Java basics 13
1.1 The structure of a Java class and source code file
Structure of a Java class 15 ■ Structure and components of
14
www.it-ebooks.info
CONTENTS xi
2.4 Operators 85
Assignment operators 87 Arithmetic operators 89
■
Operator precedence 96
2.5 Summary 98
2.6 Review notes 98
2.7 Sample exam questions 101
2.8 Answers to sample exam questions 104
www.it-ebooks.info
xii CONTENTS
an array 206
4.4 ArrayList 206
Creating an ArrayList 207 Adding elements to
■
5 Flow control
5.1
243
The if and if-else constructs 245
The if construct and its flavors 245 Missing else blocks
■
248
Implications of the presence and absence of {} in
www.it-ebooks.info
CONTENTS xiii
enhanced for loops 275 Comparing for and while loops 276
■
object of its base class 300 Which base class members are inherited
■
www.it-ebooks.info
xiv CONTENTS
interfaces 308
6.3 Reference variable and object types 310
Using a variable of the derived class to access its own object 311
Using a variable of the base class to access an object of
a derived class 312 Using a variable of an implemented interface
■
the value returned from a catch block? 363 Does the order of the ■
www.it-ebooks.info
CONTENTS xv
www.it-ebooks.info
www.it-ebooks.info
foreword
Taking the OCA Java Programmer I exam is a bit like taking a driving test. First you
learn the basics, like where the brakes are. Then you start driving, and then you get
ready to take the driving test to get your license. The written test includes things every-
one should know, things that you’ll never use after the road test, and some things that
are tricky edge cases. While the programmer exam cares about breaks more than
brakes, it certainly likes edge cases!
Consider Mala Gupta your driving instructor to get you ready for the programmer
exam. Mala points out what you’ll need to know when programming in the real
world—on your first job.
And consider this book your driver’s manual. It gives you the rules of the road of
Java, plus the gotchas that show up on that pesky written test. But don’t worry, it is
much more fun to read this book than the driver’s manual. Just like the driver’s man-
ual won’t teach you everything about driving, this book won’t teach you everything
there is to know about Java. If you haven’t yet, read an intro to a Java book first. Start
with a book like Head First Java or Thinking in Java and then come back to this book to
study for the exam.
As the technical proofreader of this book, I got to see it evolve and get better as
Mala worked on it. Through the conversations we had on little things, I learned that
Mala knows her stuff and is a great teacher of Java. While I’ve only technical proofread
a handful of books, I’ve posted reviews of over 150 technical books on Amazon, which
makes it easy to spot a book that isn’t clear or helpful. I’m happy to say that Mala’s
explanations are all very clear, and the pointers are great.
xvii
www.it-ebooks.info
xviii FOREWORD
I also got to read Mala’s posts in the certification forums at coderanch.com. She’s
been sharing updates about the exam as it comes out and posting fairly regularly for
over a year. As a senior moderator at coderanch.com, it is great to see an author sharing
her wisdom. It’s also nice to see the similarity in writing style between the forum posts
and the book. This shows the book is readable and written in an easy-to-understand,
casual style.
I particularly liked the diagrams, flow charts, and cartoons in this book. And, of
course, the annotated code examples I’ve come to expect from any Manning book.
Each chapter ends with sample mock exam questions and there is a full mock exam at
the end. This gives you good practice in getting ready for the exam. Wrong answers
are well explained so you don’t make the same mistakes over and over.
My favorite part of the book is the “Twist in the Tale” exercises. Mala gives a num-
ber of examples of how making a seemingly minor change to the code can have major
consequences. These exercises develop your attention to detail so you are more obser-
vant for the mock exam questions and the exam itself.
I had already passed the OCA Java Programmer exam with a score of 98% before
reading this book. If I hadn’t, the questions would have prepared me for the exam.
Studying from this book will give you the skills and confidence you need to become an
Oracle Certified Associate Java Programmer. Happy coding and good luck on the exam!
JEANNE BOYARSKY
SENIOR DEVELOPER & MODERATOR
CODERANCH
www.it-ebooks.info
preface
Java programmer certifications are designed to tell would-be employers whether you
really know your stuff, and cracking the OCA Java SE 7 Programmer Certification is
not an easy task. Thorough preparation is crucial if you want to pass the exam the first
time with a score that you can be proud of. You need to know Java inside and out, and
you need to understand the certification process so that you’re ready for the challeng-
ing questions you’ll face in the exam.
This book is a comprehensive guide to the 1Z0-803 exam. You’ll explore a wide
range of important Java topics as you systematically learn how to pass the certification
exam. Each chapter starts with a list of the exam objectives covered in that chapter.
Throughout the book you’ll find sample questions and exercises designed to rein-
force key concepts and prepare you for what you’ll see in the real exam, along with
numerous tips, notes, and visual aids.
Unlike many other exam guides, this book provides multiple ways to digest impor-
tant techniques and concepts, including comic conversations, analogies, pictorial rep-
resentations, flowcharts, UML diagrams, and, naturally, lots of well-commented code.
The book also gives insight into typical exam question mistakes and guides you in
avoiding traps and pitfalls. It provides
■ 100% coverage of exam topics, all mapped to chapter and section numbers
■ Hands-on coding exercises, including particularly challenging ones that throw
in a twist
xix
www.it-ebooks.info
xx PREFACE
■ Instruction on what’s happening behind the scenes using the actual code from
the Java API source
■ Mastery of both the concepts and the exam
This book is written for developers with a working knowledge of Java. My hope is that
the book will deepen your knowledge, prepare you well for the exam, and that you
will pass it with flying colors!
www.it-ebooks.info
acknowledgments
First and foremost, I thank Dheeraj Prakash—my pillar of strength, my best friend
and my husband. This book wouldn’t exist without his efforts. His constant guidance,
encouragement, and love kept me going. He helped me to get started with this book
and got me over the goal line.
My sincere gratitude to Marjan Bace, publisher at Manning, for giving me the oppor-
tunity to author this book. The Manning team has been wonderful—Scott Meyers
ensured that it was worth it for Manning to have a book on this subject. Cynthia Kane,
my development editor, played a major role in shaping the organization of individual
chapters and the overall book. It has been a real pleasure to work with her. Copyeditors
Tara Walsh, Bob Herbstman, and Nancy Wolfe Kotary not only applied their magic to
sentence and language constructions but also supplemented their editing with valuable
suggestions on technical content.
Technical Editor Brent Watson did a brilliant job of reviewing the complete book con-
tents in a limited time, catching even the smallest errors in the book. Technical Proof-
reader Jeanne Boyarsky was outstanding and an amazing person to work with. She was
very quick at reviewing the book, with an eye for detail. Proofreader Andy Carroll was
extremely capable and talented. He reviewed the final manuscript with great precision.
The technical reviewers on this book did an awesome job of reviewing the con-
tents and sharing their valuable feedback and comments: Roel De Nijs, Ivan Todorovic,
Michael Piscatello, Javier Valverde, Anayonkar Shivalkar, Kyle Smith, Niklas Rosencrantz,
Ashwin Mhatre, Janki Shah, Dmitriy Andrushko, Nitesh Nandwana, and Priyanka
Manchanda. I would also like to thank Ozren Harlovic, Review Editor, for managing
xxi
www.it-ebooks.info
xxii ACKNOWLEDGMENTS
the whole review process and meticulously funneling the feedback to make this
book better.
Martin Murtonen did an outstanding job of converting the black and white hand-
drawn illustrations into glorious images. It was amazing to scrutinize the page proofs. I
thank Dennis Dalinnik for adjusting the images in the final page proofs, which was a
lot of work. Janet Vail and Mary Piergies were awesome in their expertise at turning all
text, code, and images into publishable form. I am also grateful to Candace Gillhoolley
and Nermina Miller for their efforts in promoting the book.
I thank the MEAP readers for buying the book while it was being developed and for
their suggestions, corrections, and encouragement: Samuel Prette, David C., Diego
Poggioli, Baptize, Jayagopi Jagadeesan, David Vonka, Joel Rainey, Steve Breese, and
Jörgen Persson.
I would also like to thank my former colleagues Harry Mantheakis, Paul Rosenthal,
and Selvan Rajan, whose names I use in coding examples throughout the book. I have
always looked up to them.
I thank my nine-year-old daughter, Shreya, an artist, who often advised me on the
images that I created for the book. I’m also grateful to my younger daughter, Pavni,
who patiently waited for my attention all these months when my focus was on the
book. I thank my family for their unconditional support. The book would have been
not been possible without their love and encouragement.
www.it-ebooks.info
about this book
This book is written for developers with a working knowledge of Java who want to earn
the OCA Java SE 7 Programmer certification. It uses powerful tools and features to
make reaching your goal of certification a quick, smooth, and enjoyable experience.
This section will explain the features used in the book and tell you how to use the
book to get the most out of it as you prepare for the certification exam. More informa-
tion on the exam and on how the book is organized is available in the Introduction.
Figure 1 The Introduction to this book provides a list of all exam objectives and the corresponding
chapter and section numbers where they are covered. See the full table in the Introduction (table I.3).
xxiii
www.it-ebooks.info
xxiv ABOUT THIS BOOK
As you go through your preparation, mark your readiness score for each section. Self-
assessment is an important tool that will help you determine when you are ready to
take the exam.
The map in the Introduction shows the complete exam objective list mapped to
the relevant chapter and section numbers. You can jump to the relevant section num-
ber to work on a particular exam topic.
Chapter-based objectives
Each chapter starts with a list of the exam objectives covered in that chapter, as shown
in figure 2. This list is followed by a quick comparison of the major concepts and top-
ics covered in the chapter with real-world objects and scenarios.
Figure 2 An example of the list of exam objectives and brief explanations at the beginning of
each chapter
Section-based objectives
Each main section in a chapter starts by identifying the exam objective(s) that it cov-
ers. Each listed exam topic starts with the exam objective and its subobjective number.
In figure 3, the number 4.4 refers to section 4.4 in chapter 4 (the complete list of
chapters and sections can be found in the table of contents). The 4.3 preceding the
exam objective refers to the objective’s numbering in the list of exam objectives on
Oracle’s website (the complete numbered list of exam objectives is given in table I.3 in
the Introduction).
Figure 3 An example of the beginning of a section, identifying the exam objective that it covers
Exam tips
Each chapter provides multiple exam tips to re-emphasize the points that are the most
confusing, overlooked, or frequently answered incorrectly by candidates and that
therefore require special attention for the exam. Figure 4 shows an example.
www.it-ebooks.info
ABOUT THIS BOOK xxv
Notes
All chapters also include multiple notes, which draw your attention to points that
should be noted while you’re preparing for the exam. Figure 5 shows an example.
Sidebars
Sidebars contain information that may not be directly relevant to the exam but that is
related to it. Figure 6 shows an example.
Images
I’ve used a lot of images in the chapters for an immersive learning experience. I
believe that a simple image can help you understand a concept quickly, and a little
humor can help you to retain information longer.
Simple images are used to draw your attention to a particular line of code (as
shown in figure 7).
www.it-ebooks.info
xxvi ABOUT THIS BOOK
Figure 7 An example image that draws your attention to a particular line of code
I’ve used pictorial representation of data in arrays (figure 8) and other data types to
aid visualization and understanding.
A
0 0
B
multiStrArr 1 1
null
2
Jan
0
Feb
1
Mar Figure 8 An example pictorial
2
representation of data in an array
To reinforce important points and help you retain them longer, a little humor has
been added using comic strips (as in figure 9).
Figure 9 An example of a little humor to help you remember that the finally block
always executes
I’ve also used images to group and represent information for quick reference. Fig-
ure 10 shows an example of the protected members that can be accessed by derived
www.it-ebooks.info
ABOUT THIS BOOK xxvii
Derived classes
An image can also add more meaning to a sequence of steps also explained in the
text. For example, figure 11 seems to bring the Java compiler to life by allowing it to
talk with you and convey what it does when it gets to compile a class that doesn’t
define a constructor. Again, try a few of your own! It’ll be fun!
Poor class
Employee doesn’t
have a constructor.
Let me create
class Employee { one for it.
String name; class Employee {
int age; String name;
In
} int age;
Employee() {
Java
super();
compiler Default
name = null;
constructor
Out age = 0;
}
}
The exam requires that you know multiple methods from classes such as String,
StringBuilder, ArrayList, and others. The number of these methods can be over-
whelming, but grouping these methods according to their functionality can make this
task a lot more manageable. Figure 12 shows an example of an image that groups
methods of the String class according to their functionality.
String methods
Figure 12 An example image used to group methods of the String class according to their
functionality.
www.it-ebooks.info
xxviii ABOUT THIS BOOK
Code snippets that define multiple points and that may result in the nonlinear execu-
tion of code can be very difficult to comprehend. These may include selection state-
ments, loops, or exception-handling code. Figure 14 is an example of an image that
clearly outlines the lines of code that will execute.
Figure 14 An example of flow of control in a code snippet that may define multiple points of
nonlinear execution of code
www.it-ebooks.info
ABOUT THIS BOOK xxix
even small code modifications can change the behavior of your code. They should
encourage you to carefully examine all of the code in the exam.
My main reason for including these exercises is that on the real exam, you may get to
answer more than one question that seems to define exactly the same question and answer
options. But upon closer inspection, you’ll realize that these questions differ slightly, and
that these differences change the behavior of the code and the correct answer option.
The answers to all of the Twist in the Tale exercises are given in the appendix.
Code Indentation
Some of the examples in this book show incorrect indentation of code. This has been
done on purpose because on the real exam you can't expect to see perfectly indented
code. You should be able to comprehend incorrectly indented code to answer an
exam question correctly.
Review notes
When you’re ready to take your exam, don’t forget to reread the review notes a day
before or on the morning of the exam. These notes contain important points from
each chapter as a quick refresher.
Exam questions
Each chapter concludes with a set of 10 to 11 exam questions. These follow the same pat-
tern as the real exam questions. Attempt these exam questions after completing a chapter.
Author Online
The purchase of OCA Java SE 7 Programmer I Certification Guide includes free access to a pri-
vate forum run by Manning Publications where you can make comments about the book,
ask technical questions, and receive help from the author and other users. You can access
and subscribe to the forum at www.manning.com/OCAJavaSE7ProgrammerICertification-
Guide. This page provides information on how to get on the forum once you’re registered,
what kind of help is available, and the rules of conduct in the forum.
Manning’s commitment to our readers is to provide a venue where a meaningful
dialogue among individual readers and between readers and the author can take
place. It’s not a commitment to any specific amount of participation on the part of the
authors, whose contribution to the book’s forum remains voluntary (and unpaid). We
suggest you try asking the author some challenging questions, lest her interest stray!
The Author Online forum and the archives of previous discussions will be accessi-
ble from the publisher’s website as long as the book is in print.
www.it-ebooks.info
about the author
Mala Gupta has a Master’s degree in Computer Applications (MCA). She is an Oracle
Certified Associate-Java SE 7 Programmer, Java Sun Certified Web Component Devel-
oper (SCWCD), and Sun Certified Java 2 Programmer (SCJP).
She has more than 12 years of experience in software design and development and
training. Her work experience is in Java technologies, primarily as an analyst, pro-
grammer, and mentor.
Mala has worked with international training and software services organizations in
Europe and development centers in India on various Java-based portals and web appli-
cations. She has experience in mentoring and ramping up teams’ technical and pro-
cess skills.
She is the founder and lead mentor of a portal (http://ejavaguru.com) that has
offered an online Java course in Java Programmer certification since 2006.
xxx
www.it-ebooks.info
about the cover illustration
The figure on the cover of the OCA Java SE 7 Programmer I Certification Guide is captioned
a “Morlach.” This illustration is taken from a recent reprint of Balthasar Hacquet’s
Images and Descriptions of Southwestern and Eastern Wenda, Illyrians, and Slavs published
by the Ethnographic Museum in Split, Croatia, in 2008. Hacquet (1739–1815) was an
Austrian physician and scientist who spent many years studying the botany, geology,
and ethnography of many parts of the Austrian Empire, as well as the Veneto, the
Julian Alps, and the western Balkans, inhabited in the past by peoples of many differ-
ent tribes and nationalities. Hand-drawn illustrations accompany the many scientific
papers and books that Hacquet published.
Morlachs were a rural population that lived in the Dinaric Alps in the western Bal-
kans hundreds of years ago. Many of them were shepherds who migrated in search of
better pastures for their flocks, alternating between the mountains in the summer and
the seashore in the winter. They were also called “Vlachs” in Serbian and Croatian.
The rich diversity of the drawings in Hacquet’s publications speaks vividly of
the uniqueness and individuality of Alpine and Balkan regions just 200 years ago. This
was a time when the dress codes of two villages separated by a few miles identified peo-
ple uniquely as belonging to one or the other, and when members of an ethnic
tribe, social class, or trade could be easily distinguished by what they were wearing.
Dress codes have changed since then and the diversity by region, so rich at the
time, has faded away. It is now often hard to tell the inhabitant of one continent from
another and the residents of the picturesque towns and villages in the Balkans are not
readily distinguishable from people who live in other parts of the world.
xxxi
www.it-ebooks.info
xxxii ABOUT THE COVER ILLUSTRATION
We at Manning celebrate the inventiveness, the initiative, and the fun of the com-
puter business with book covers based on costumes from two centuries ago brought
back to life by illustrations such as this one.
www.it-ebooks.info
Introduction
This book is intended specifically for individuals who wish to earn the Oracle Certi-
fied Associate (OCA) Java SE 7 Programmer certification (exam number 1Z0-803). It
assumes that you are familiar with Java and have some experience working with it.
www.it-ebooks.info
2 Introduction
If you are completely new to Java or to object-oriented languages, I suggest that you
start your journey with an entry-level book and then come back to this one.
1 Disclaimer
The information in this chapter is sourced from Oracle.com, public websites, and user
forums. Input has been taken from real people who have earned Java certification,
including the author. All efforts have been made to maintain the accuracy of the con-
tent, but the details of the exam—including the exam objectives, pricing, exam pass
score, total number of questions, maximum exam duration, and others—are subject
to change per Oracle’s policies. The author and publisher of the book shall not be
held responsible for any loss or damage accrued due to any information contained in
this book or due to any direct or indirect use of this information.
Number of questions 90
Pricing US$300
www.it-ebooks.info
Introduction 3
Java SE 7 Java SE 7
Java SE 6 Java SE
Developer
Java SE 5/6 Java SE 6/5
Java EE 5 Java EE 6
Business Enterprise
Component JavaBeans
Developer Developer
Java EE
Java EE 5 Web Java EE 6 Web
Services Services
Developer Developer
Java EE 6 Java
Persistence API
Developer
Java ME Mobile
Application
Developer Java ME
Figure 1 OCA Java SE 7 Programmer certification is the entry-level certification in the Java certification
roadmap. It’s a prerequisite for the OCP Java SE 7 Programmer II exam (1Z0-804), which is a prerequisite
for most of the other certifications in Java.
These two exam versions are quite different as far target audience, total number of
questions, passing score, and exam duration are concerned, as listed in table 2.
www.it-ebooks.info
4 Introduction
Table 2 Comparing exams: OCA Java SE 7 Programmer I and OCA Java SE 5/6
Total number of 90 51
questions
Figure 2 shows a detailed comparison of the exam objectives of OCA Java SE 5/6 (1Z0-
850) and OCA Java SE 7 Programmer I (1Z0-803). It shows objectives that are exclusive
to each of these exam versions and those that are common to both. The first column
shows the objectives that are included only in OCA Java SE 5/6 (1Z0-850), the middle
column shows common exam objectives, and the right column shows exam objectives
covered only in OCA Java SE 7 Programmer I (1Z0-803).
www.it-ebooks.info
Introduction to OCA Java SE 7 Programmer certification 5
Figure 2 Comparing objectives of exams OCA Java SE 5/6 and OCA Java SE 7 Programmer I
www.it-ebooks.info
6 Introduction
Table 3 Exam objectives and subobjectives mapped to chapter and section numbers,
with readiness score
1.4 Import other Java packages to make them Section 1.3 !!!
accessible in your code
2.1 Declare and initialize variables Sections 2.1 and 2.3 !!!
2.2 Differentiate between object reference Sections 2.1 and 2.3 !!!
variables and primitive variables
3.3 Test equality between strings and other Section 4.1 !!!
objects using == and equals()
www.it-ebooks.info
Introduction to OCA Java SE 7 Programmer certification 7
Table 3 Exam objectives and subobjectives mapped to chapter and section numbers,
with readiness score (continued)
5.2 Create and use for loops, including the Sections 5.3 and 5.4 !!!
enhanced for loop
6.8 Determine the effect upon object refer- Section 3.8 !!!
ences and primitive values when they
are passed into methods that change
the values
7.2 Develop code that demonstrates the use Section 6.6 !!!
of polymorphism
7.5 Use super and this to access objects Section 6.5 !!!
and constructors
7.6 Use abstract classes and interfaces Sections 1.5, 6.2, and 6.6 !!!
www.it-ebooks.info
8 Introduction
Table 3 Exam objectives and subobjectives mapped to chapter and section numbers,
with readiness score (continued)
8.3 Describe what exceptions are used for in Section 7.1 !!!
Java
When you are ready to take the exam, you should ideally be able to select three stars for
each item in the table. But let’s define a better way to evaluate your exam readiness.
Once you have marked all the stars in the previous chart, calculate your total points
using the following values:
! 1 point
!! 2 points
!!! 4 points
As the maximum number of points is 172 (43 objectives × 4), a score in the range of
150–172 is considered a good score.
You can download a PDF version of the form from the book’s web page at http://
manning.com/gupta/ if you wish to mark yourself more than once.
3 FAQs
You might be anxious when you start your exam preparation or even think about get-
ting certified. This section can help calm your nerves by answering frequently asked
questions on exam preparation and on writing the exam.
www.it-ebooks.info
FAQs 9
exams. Such changes may not be major, but it is always advisable to check Oracle’s
website for the latest exam information when you start your exam preparation.
WHAT IS THE BEST WAY TO PREPARE FOR THIS EXAM?
At the time of writing this book, there weren’t many resources available to prepare for
this exam. Apart from this book, Oracle offers an online course on this exam.
Generally, candidates use a combination of resources, such as books, online study
materials, articles on the exam, free and paid mock exams, and training to prepare for
the exam. Different combinations work best for different people, and there is no one
perfect formula to prepare. Depending on whether training or self-study works best
for you, you can select the method that is most appropriate for you. Combine it with a
lot of code practice and mock exams.
HOW DO I KNOW WHEN I AM READY FOR THE EXAM?
You can be sure about your exam readiness by consistently getting a good score in the
mock exams. Generally, a score of 80% and above in approximately seven mock exams
(the more the better) attempted consecutively will assure you of a similar score in the
real exam. You can also test your exam readiness using table 3. This table contains exam
objectives and subobjectives with multiple stars representing different levels of expertise.
HOW MANY MOCK TESTS SHOULD I ATTEMPT BEFORE THE REAL EXAM?
Ideally, you should attempt at least 10 mock exams before you attempt the real exam.
The more the better!
I HAVE TWO YEARS’ EXPERIENCE WORKING WITH JAVA. DO I STILL NEED TO PREPARE FOR
THIS CERTIFICATION?
It is important to understand that there is a difference between the practical knowl-
edge of having worked with Java and the knowledge required to pass this certification
exam. The authors of the Java certification exams employ multiple tricks to test your
knowledge. Hence, you need a structured preparation and approach to succeed in
the certification exam.
WHAT IS THE IDEAL TIME REQUIRED TO PREPARE FOR THE EXAM?
The preparation time frame mainly depends on your experience with Java and the
amount of time that you can spend to prepare yourself. On average, you will require
approximately 150 hours of study over two or three months to prepare for this exam.
Again, the number of study hours required depends on individual learning curves
and backgrounds.
It’s important to be consistent with your exam preparation. You cannot study for a
month and then restart after, say, a gap of a month or more.
DOES THIS EXAM INCLUDE ANY UNSCORED QUESTIONS?
A few of the questions that you write in any Oracle exam may be marked unscored.
Oracle’s policy states that while writing an exam, you won’t be informed whether a
question will be scored. You may be surprised to learn that as many as 10 questions out
of the 90 questions in the OCA Java SE 7 Programmer I exam may be unscored. Even if
you answer a few questions incorrectly, you stand a chance of scoring 100%.
www.it-ebooks.info
10 Introduction
Oracle regularly updates its question bank for all its certification exams. These
unscored questions may be used for research and to evaluate new questions that can
be added to an exam.
CAN I START MY EXAM PREPARATION WITH THE MOCK EXAMS?
If you are quite comfortable with the Java language features, then yes, you can start your
exam preparation with the mock exams. This will also help you to understand the types
of questions to expect in the real certification exam. But if you have little or no experi-
ence working with Java, or if you are not quite comfortable with the language features of
Java, I don’t advise you to start with the mock exams. The exam authors often use a lot
of tricks to evaluate a candidate in the real certification exam. Starting your exam prepa-
ration with mock exams will only leave you confused about the Java concepts.
SHOULD I REALLY BOTHER GETTING CERTIFIED?
Yes, you should, for the simple reason that employers bother about the certification of
employees. Organizations prefer a certified Java developer over a noncertified Java
developer with similar IT skills and experience. The certification can also get you a
higher paycheck than uncertified peers with comparable skills.
www.it-ebooks.info
FAQs 11
www.it-ebooks.info
12 Introduction
www.it-ebooks.info
Java basics
[1.2] Define the structure of a Java class. Structure of a Java class, with its components: pack-
age and import statements, class declarations, com-
ments, variables, and methods.
Difference between the components of a Java class
and that of a Java source code file.
[1.3] Create executable Java applications The right method signature for the main method to
with a main method. create an executable Java application.
The arguments that are passed to the main method.
[1.4] Import other Java packages to make Understand packages and import statements. Get the
them accessible in your code. right syntax and semantics to import classes from
packages and interfaces in your own classes.
[7.6] Use abstract classes and inter- The implication of defining classes, interfaces, and
faces. methods as abstract entities.
[6.2] Apply the static keyword to meth- The implication of defining fields and methods as
ods and fields. static members.
Imagine you’ve set up a new IT organization that works with multiple developers.
To ensure a smooth and efficient workflow, you’ll define a structure for your orga-
nization and a set of departments with separate assigned responsibilities. These
departments will interact with each other whenever required. Also, depending on
13
www.it-ebooks.info
14 CHAPTER 1 Java basics
NOTE When you see a certification objective callout such as the preceding one,
it means that in this section, we’ll cover this objective. The same objective may
be covered in more than one section in this chapter or in other chapters.
This section covers the structure and components of both a Java source code file (.java
file) and a Java class (defined using the keyword class). It also covers the differences
between a Java source code file and a Java class.
First things first. Start your exam preparation with a clear understanding of what is
required from you in the certification exam. For example, try to answer the following
query from a certification aspirant: “I come across the term ‘class’ with different
meanings—class Person, the Java source code file—Person.java, and Java bytecode
stored in Person.class. Which of these structures is on the exam?” To answer this ques-
tion, take a look at figure 1.1, which includes the class Person, the files Person.java and
Person.class, and the relationship between them.
As you can see in figure 1.1, a person can be defined as a class Person. This class
should reside in a Java source code file (Person.java). Using this Java source code file,
the Java compiler (javac.exe on Windows or javac on Mac OS X/Linux/UNIX) gener-
ates bytecode (compiled code for the Java Virtual Machine) and stores it in Person.class.
The scope of this exam objective is limited to Java classes (class Person) and Java
source code files (Person.java).
www.it-ebooks.info
The structure of a Java class and source code file 15
fined as
De side
s in
Re
Person.java Person.class
In
class Person {
class Person {
String name;
String getName() { Java
return name; compiler
}
}
Out
Figure 1.1 Relationship between the class Person, the files Person.java and Person.class, and how
one transforms into another
Package statement 1
Import statements 2
Comments 3a
Class declaration { 4
Variables 5
Comments 3b
Constructors 6
Methods 7
Nested classes
Not included in OCA Java SE 7
Nested interfaces Programmer I exam
Enum Figure 1.2 Components of
} a Java class
www.it-ebooks.info
16 CHAPTER 1 Java basics
PACKAGE STATEMENT
All Java classes are part of a package. A Java class can be explicitly defined in a named
package; otherwise it becomes part of a default package, which doesn’t have a name.
A package statement is used to explicitly define which package a class is in. If a class
includes a package statement, it must be the first statement in the class definition:
package certification;
The package statement
class Course { should be the first
The rest of the code
for class Course statement in a class
}
The following code will also fail to compile, because it places the package statement
within the class definition:
class Course { A package statement can’t be placed within the curly
package com.cert; braces that mark the start and end of a class definition
}
Also, if present, the package statement must appear exactly once in a class. The follow-
ing code won’t compile:
package com.cert; A class can’t define multiple
package com.exams; package statements
class Course {
}
www.it-ebooks.info
The structure of a Java class and source code file 17
import certification.ExamQuestion;
class AnnualExam {
ExamQuestion eq; Define a variable
}
of ExamQuestion
As you can see in the previous example code, the class AnnualExam doesn’t define
the package statement, but it defines the import statement to import the class
certification.ExamQuestion.
If a package statement is present in a class, the import statement must follow the
package statement. It’s important to maintain the order of the occurrence of the package
and import statements. Reversing this order will result in your code failing to compile:
import certification.ExamQuestion;
package university; The code won’t compile because an
import statement can’t be placed
class AnnualExam {
before a package statement
ExamQuestion eq;
}
www.it-ebooks.info
Exploring the Variety of Random
Documents with Different Content
the sunshine of something that was greater than she, too great to
be retained in her bosom.
To sing.... But the house was asleep. She alone was awake. That
was delightful ... to be alone. She felt an irrepressible smile on her
lips. “I love him ...” she whispered it softly, but she felt as though in
these words she had sung all her songs.
Before the week was over Thomas Illey called again at the old
house. He came alone, Martha had gone into the country.
“To the mother of her fiancé,” said Illey. “It is an old engagement.
The wedding will be in autumn. Then that worry will be over too.”
He said no more about it. On the whole he spoke little. Nor did
Anne say much, but the silence between them was bright and
happy.
Tini’s knitting needles clattered rapidly underneath the lamp-
shade; and the expression of her long, stiff face was that of an
elderly person contemplating spring through the window.
Now and then Anne started, as if his look had called to her by
name. She smiled at Thomas over the embroidery screen, then bent
her head down again and the stones of her rings sparkled at regular
intervals as she drew the silk upwards.
John Hubert came up from the office. Mamsell Tini stuck her
knitting needles into the ball of wool. She got up. Her steps died
away in the corridor and John Hubert spoke again about business,
the town and building.
When this happened Anne began to hear the ticking of the clock.
If only once she could be alone with Thomas, she would go to the
clock, push its hand back and that would tell him all she dared not
express in words. But they were never alone. She could only speak
to him when she was singing.
Did he understand it? Did he like to hear it? She did not know.
Illey was different from everyone she had known hitherto. When
their eyes met in silence she felt herself quite near to him. When
they spoke to each other it seemed to her that they were far, far
apart and that their voices had to travel a great distance, the words
being dulled on the way.
Anne began to grow fond of silence which she could fill with the
warmth of her heart.
Summer passed away.
Thomas Illey came more and more frequently and stayed longer
and longer. John Hubert surrendered his evening stroll to remain in
his company. Tini produced the best china cups from the glass
cupboard when he was expected. Florian ran to open the door.
The days became shorter. Now and then Netti lit a fire in the
stove.
One evening Illey was even more taciturn than usual.
Tini dropped her ball of wool. While she bent down for it Thomas
turned suddenly to Anne and said in a very low whisper:
“I shall soon leave Pest. Give me a word that I can carry with me.”
Mamsell was now sitting up again, stiff and straight, on her chair
and her knitting needles knocked each other diligently.
Anne’s hand had slid down from the embroidery frame and her
eyes became dull as if all their lustre had melted away.
“You are going?” Her voice was very dim.
“What did you say?” asked Miss Tini, absent-mindedly. She stuck
one of the knitting needles sideways into the knot of her hair and
began to count the stitches.
Illey watched with silent despair the slow-moving lips of Mamsell
as he impatiently twirled the old seal ring round and round.
“I am going to Martha’s wedding. I have some other business too,
so who knows when I can come back again.”
Anne looked at the ring and then lifted her eyes to Thomas. She
would have liked to tell him, implore him, to take her with him too,
to abide faithfully by her as he clung to that ring and never leave her
alone again.
“Come to-morrow with Christopher to the Palatine’s Island,” said
Illey suddenly. His voice became harsh and commanding. “We shall
meet at the pier.” Then he continued, more softly: “Do sing
something....” He said this as if to clear the air of the grating
vibrations of his former words.
“You really want me to?” Anne’s eyes blazed up. The dominating
voice had made her feel as though Thomas had laid hands on her, as
though he had bent her wrist with tender force. That unconscious
delight of women in the humiliations of love flashed through her. She
blushed and asked:
“What do you like? Schubert, Mozart or Schumann?”
“The voice of Anne Ulwing,” answered Illey simply, looking straight
into her eyes.
When the song died away, Thomas rose.
“Au revoir,” said Anne, and her hand, like a little bird snuggling up
in its nest, took refuge in his strong, warm grip. They remained like
that for an instant. Then Anne was again alone. She ran back to the
piano.
Even now she was still singing for Thomas. She sent her voice
after him, to follow him down the stairs, to attend him part of the
way. Perhaps he would hear it and turn back.
She drew aside the muslin curtains of the window. Lamps were
already burning in the streets. Someone on the other side. Anne
leant eagerly forward.
It was Otto Füger.
For a short time the younger Füger remained standing there, and
turned his head in the direction whither Thomas Illey had gone.
From the office window a beam of light stretched to the street. In
what had once been the study of Ulwing the builder the green-
shaded lamps were lit up.
This evening John Hubert remained exceptionally long at his
writing desk. He sat there in a state of collapse and his colourless
skin formed two empty folds under his chin. His hand lay inert on a
bundle of papers which had been presented to him for signature.
He rose heavily. He was looking for the second time through the
door which led to the adjoining office. Once Augustus Füger used to
work there, but, since an attack of apoplexy had paralysed the little
book-keeper’s right arm, his son Otto occupied his place.
“Where can he be?” mused John Hubert, looking through the door
into the empty office.
He returned to his seat at the writing desk. His eyes gazed at the
plan of Pest-Buda, but he did not see anything of it. Every now and
then his head twitched, as if he sought to shake up behind his
forehead the dull, dense matter that refused to act. He sighed and
desisted from the effort. He shut his eyes. But now that he wanted
to rest, his brain became active and a whirling chaos moved about it.
He thought suddenly of Christopher.
Otto Füger entered quietly through the door. Cold rage was in his
eye and his lips were compressed and straight. But as soon as he
came within the light of the lamps he was already smiling.
John Hubert continued his reflections aloud:
“Somebody mentioned Christopher’s name to-day at the money-
changer’s. The clerk spoke of him behind the counter. When I turned
to them they caught their breath. I can’t understand it.” He looked
anxiously at young Füger. “Do you know anything?”
Otto Füger did not answer at once. At this moment he hated
furiously everybody living in that house. He hated the others
because of Anne and on account of that stuck-up Illey whose looks
always passed above his head. Now he had his chance to revenge
himself on them for having been born in the back-lodgings of an
insignificant book-keeper, for being poor and striving vainly. He
looked humbly to the ground and feigned to suffer from the painful
necessity of his disclosures.
“It is hard on me to have to betray Mr. Christopher. I have always
tried to restrain him, I have implored him....”
“What is going on behind my back?” John Hubert’s voice bubbled
out heavily between his blanched lips.
When the whole truth was revealed to him, he repeated painfully:
“He gambles ... the whole town knows it.... He loses ... bills of
exchange?...” He asked terrified: “What is the amount?”
“One hundred and eighty thousand florins....”
For an instant, John Hubert straightened himself in the chair, then
his body collapsed slowly to one side. His high collar alone kept his
relaxed, waxy face in position. In a few minutes he had turned quite
old.
Otto Füger watched his chief cunningly. He judged from his
altered attitude what was the right thing to say.
“We must not despair, sir. At bottom Mr. Christopher is a good,
God-fearing young gentleman. It is all the fault of bad company. I
always told him so. Those young gentry fellows from the country
preyed on him. They have got rich Ulwing’s money. But don’t punish
him, sir. I beg of you, let me bear your anger, for have I not sinned
more than he for keeping it quiet?”
He hung his head penitently, as if expecting judgment.
“You are a good fellow, Otto,” said John Hubert, deeply touched.
“We will save the reputation of the firm,” young Füger said
solemnly. “As for Mr. Christopher, if I may venture to give advice, we
shall have to tear him from the tempters. Perhaps abroad....”
“Send him abroad? Yes,” John Hubert became suddenly
determined. “That was once the plan of my late father. You advise
Frankfurt? All right, let it be Frankfurt.”
The book-keeper had not expected to get his way so easily. He
became more enterprising.
“He had better go among unpretentious working-class people, till
he settles down. Meanwhile you might like to choose for Miss Anne
some level-headed business man as a husband; he might enter the
firm as a partner and relieve your mind, sir, of all the worries.”
That was a new hope. John Hubert pulled his necktie up. “A
serious man of business to stand by Christopher. Somebody
belonging to the family. Anne’s husband....” Thomas Illey’s image
intruded unpleasantly on his memory. “We must prevent them from
meeting again.” Life had been so exacting to him that now he would
insist on getting his own back. He had always been merciless to
himself, now he would show no mercy to others.
“Yes, that would free me from all care,” he murmured as if taking
counsel with himself. “Anne’s husband.... But who is it to be?”
Otto Füger smiled modestly. He took his spectacles off, breathed
on them and wiped them while holding them up to his left eye.
John Hubert, for reasons unknown to him, thought of the son of
Martin George Münster. Charles Münster would bring capital into the
business, he had brains....
He clapped Otto Füger on the shoulder.
“Thank you!”
Young Füger looked after him dejected. He had expected
something else.
Next day Christopher left the old house. And at the pier of the
Danube Thomas Illey waited in vain for Anne.
White frost fell over the autumn roses in the garden.
CHAPTER XIV
Rain had collected in the gargoyle and gave off a hopeless gurgle as
if someone were sobbing under the steep double roof.
Out of doors the autumn evening fell sadly. On the window panes
of the sunshine room raindrops ran down like tears on a transparent
grey face.
Silence reigned in the deserted old nursery. Since Christopher’s
departure Anne had been very lonely. She would often rise from the
work table during the afternoon and go quietly to the door. She
opened it quickly, nobody was there. She looked down into the
depths of the staircase. The house was silent. She decided to count
up to a hundred, then wait no longer. Twice she counted up to a
hundred, and even after that she looked back from the threshold.
At night when Netti lit the lamp and Florian bolted the front door,
Anne’s eyes more than once filled with tears. She felt a prisoner. Life
remained outside the walls of her prison. Again a useless day had
drawn to an end, that at its dawning had promised so generously. It
tortured her artfully while it lasted, and in the end achieved nothing.
Thomas Illey came no more.
Anne’s little face became quite pale and thin. She began to be
afraid. Perhaps Illey went to someone else now, perhaps he was
angry? The last time he saw her he asked her so earnestly to go the
next day to the Danube pier. And she could not go, could send no
message, could not write. Christopher had to leave and their father
was very strict with both of them.
“Why does he not come? Where is he?”
She pressed her face against the window pane. Whenever the
front door bell rang the blood rushed to her heart. She waited, then
hung her head wearily.
In the sunshine room the furniture began to whisper. The walls
too remembered. The door handle was familiar with Thomas’s hand.
The shaded lamp, the clock under the glass globe, they all told her
that they had seen him many times.
Anne turned her face away. The memories wounded her. She
clasped her hands in prayer for respite from her tortures.
Hours passed. Tini came in and started to read her fortune with
cards. “All your sorrows will come to an end, my little dove,” she said
when she finished her game.
“I have no sorrows,” answered the girl and tried to hold her head
high.
John Hubert’s voice said:
“Anne, a visitor!”
Of late Charles Münster had often come to the house. In the
evening he sat comfortably in the green room, approving everything
John Hubert said, and when he could think of nothing to say, he
carelessly twirled the thumbs of his big, red hands.
Those hands annoyed Anne. They became embarrassed, blushed
like human faces, struggled, while Charles Münster remained placid
and tedious in his inordinately long Sunday coat.
“Why does he come?” wondered Anne wearily, while sitting
opposite him.
One day she learned that too; Charles Münster had asked her
father for her hand.
“It is a very honourable proposal and very advantageous,” said
John Hubert to his daughter. “The house of Münster has a good
reputation and is serious. The young man is intelligent and owns
some capital.”
Anne’s heart sank while she looked at him and then the blood
rushed to her face. All her life she had striven to repress her will;
she had always obeyed, but what she was now asked to do roused
her to rebellion.
“No, never!” And her voice rang out like a hammer dropping on
steel.
John Hubert was startled. That was the voice of Ulwing the
builder.
“I spoke too soon,” he thought, vexed. “I ought to have waited a
little longer.”
Then he waited. Outside the snow was falling already.
In the next few weeks Anne’s face became more and more
transparent. She did not sleep at night. She sang no longer, nor did
she laugh and during the long evenings she sat silent in the green
room, while her father worked at the writing table with the
innumerable drawers.
John Hubert had now to use spectacles for reading. He pushed
them up on his forehead and looked stealthily at Anne. Gradually he
became anxious. He thought of his own life. He had never been
happy, had never made anybody else happy.
“Are you ill?” he asked suddenly.
“No.”
“Have you any pain?”
Anne did not answer but her eyes asked him why he tortured her.
John Hubert bent down. He turned the pages of his ledger. Anne
heard him sigh anxiously.
“Have you had bad news from Christopher?” she asked, going to
the writing table. “No? Is it the business?... Speak to me about it, for
I too am an Ulwing.”
John Hubert closed the book in which he had been reckoning.
“You would not understand it.”
“But I could learn to....”
“You just go on embroidering, singing. You have no need to know
about business. It is not suitable for women. God has created you
for other ends.” But this sentence aroused his conscience. He
became embarrassed.
“You have not yet forgotten Thomas Illey?” he whispered casting
his eyes down.
“I have not forgotten him.”
A few days later Grandfather Jörg came in the evening to take
Anne to a concert. In the carriage the old gentleman began to
mention Charles Münster.
“Is he too like all the others?” the girl thought and looked sadly at
her grandfather. Once he had been to prison for sympathizing with
the freedom of others; and now he spoke against his grandchild’s
freedom.
In the concert hall the crowd was already large. Innumerable
candles burned in the gilt wooden chandelier. Their flames wove a
peaceful yellow light in the air. On the platform the piano stood
open. The orchestra was tuning up and this sounded like birds with
sharp beaks pecking at the stringed instruments.
A few reporters stood near the wall. Anne heard them agree in
advance as to what they would say in next day’s papers. In the stalls
well-known merchants from the inner town, wives of rich citizens,
officers in uniform, and right in front bejeweled ladies in huge
crinolines, noble gentlemen in Hungarian national costume.
The family of Müller the chemist nodded to them. The Münster
daughters were there too. In the back rows the newcomers moved
their chairs. Some laughed and cleared their throats, then suddenly,
as if moved by a common spring, all the heads turned towards the
platform. Then all became silent.
Anne glanced over the faces. The crowd seemed to her like an
empty vessel gaping towards the piano in expectation of being filled
with sounds and emotions. Her heart was full of her young distress
and she felt afraid that at the first sound her sufferings would
overflow through her eyes.
All of a sudden she became strangely restless, as if some one had
touched her from a distance. She turned her head quickly. The blood
throbbed in her veins as her look met the dark, sad eyes of Thomas
Illey. And the two glances united through space.
Waves surged between them. A wild tumult of cheers broke out.
The round of applause echoed like a thunderstorm from the walls.
The great artist stood on the platform, high above everybody. His
long white hair waved softly round his marble brow. He inclined his
wiry body before the homage.
Then the piano burst out under his hands. And the sounds sang,
crept, stormed furiously, coaxed voluptuously, and dissolved in a
smile. The artist with the marble brow conjured up harmonies from
the piano that had not existed before him and were not to be after
him.
The crowd listened with bated breath, spellbound. And the music
continued like a swelling tide. Then it became tender like a dying
echo. It broke forth again with superb impetuosity. Sounds wrought
in fire rose and those who heard them lived the creative moments of
Beethoven, Sebastian Bach and Weber over again. These sublime
moments were resuscitated by the master whose playing was
forever the begetting of gods.
Anne Ulwing’s soul was carried on glowing wings by Beethoven’s
Appassionata to Thomas over the heads of the crowd. She felt that
the waves of the music swept them together and that they became
swallowed up in some boundless glittering veil.
The hall was delirious again. People stood up. Some rushed to the
platform and continued to applaud there.
The artist began to play a composition of his own. And then, as if
his marble countenance had been set aflame, fire shone on his
brow, fire streamed from his eyes and the creative artist wandered
and was alone by himself.
Anne turned towards the piano. This was different from anything
she had ever heard. Long-forgotten words recurred to her mind:
“One has to create like God. Even the clay has to be created anew.”
Applause rose again, but the clapping seemed more restrained. It
was addressed to the virtuoso, not to the creator.
“They don’t understand him,” said Anne disappointed.
“It is not yet safe to admire this music. It came too early ...” and
again the words of Adam Walter came to her mind.
Then everything was forgotten. Her eyes searched for Thomas in
the crowd thronging towards the exit. In the dust-laden heat of the
cloak-room people pushed each other. Under the porch the doors of
the carriages slammed. A hoarse voice shouted the names of the
coachmen.
Anne saw Florian and made a sign to him. Ulrich Jörg was already
in the carriage.
“I should like to walk,” said the girl hurriedly. The old gentleman
was sleepy. The horses of the next carriage became restive in the
cold. The door banged. Anne felt herself free.
“Let us go....”
Florian’s broad, good-natured face turned to her for an instant in
wonder. Then he followed her obediently in the snow.
A motionless figure stood at the street corner under a lamp
peering into the windows of the passing carriages. Suddenly he
looked no longer towards the carriages. His dark sad eyes rested on
Anne. He held his hat low in his hand and snow fell on his thin face.
They clasped each other’s hands and the peace of their mind was
like the languid moment, still incredible, when a bodily pain has
abruptly ceased to torture.
The sound of rolling carriages spread in all directions. Occasional
laughter flared up among the human voices, dying away at a
distance. After that, only the snow was falling in slow, shiny flakes.
By tacit agreement they started, side by side, into the great
whiteness.
Anne did not feel the cold. The furs slid down her bare shoulders
and her low shoes sank deep into the snow. Illey gazed at her in
rapture, then pulled himself together. He wanted to appear calm, but
his voice was strangely changed.
“When I saw the posters of the concert, I began to hope that we
might meet. It all happened more wonderfully than my wildest
hopes.”
Anne too tried to control herself.
“So you really did not go for the music’s sake?” she asked in a
whisper, smiling.
“I never go to concerts,” said Illey candidly. “I don’t understand
the higher music.”
Anne turned to him anxiously:
“Then you did not understand what I sang to you?”
“I did not understand the music, but I understood her who
produced it.”
Anne’s thought became confused. Till then she had thought that
they met, united in music.... And now Thomas told her that he did
not understand the only language which her soul, her blood could
speak.... It did not matter, nothing mattered so long as he was here,
if only he could be at her side.
She drew her head back a little and with eyes half shut looked
longingly at Illey’s shoulders as though she would, by the intensity of
her regard, build a nest there for her little head.
Thomas began to walk at a noticeably slow pace. Then Anne too
noticed the snow-covered lamp in front of the Ulwings’ house.
“I have sought this moment for a long time,” said Illey quickly. “I
was seeking it on the island when I waited for you so long—till the
stars appeared and the ferryman lit a fire for the night. Next day I
was there too. I have pulled the bell at your door many times. I saw
your face through the window, I heard you play the piano, yet I was
told you were not in. Florian avoided my eyes when he said that. I
understood. It was not desired that I should come.”
“And I was expecting you.” There was so much suffering in Anne’s
veiled voice that all became clear to Illey.
At this moment they came in sight of the house. They stepped so
slowly that they remained practically on the same spot, yet the
distance grew smaller. The porch moved out of the wall and came to
meet them rapidly, dark through the glittering whiteness. The two
pillar-men came with it too. They leaned more and more from under
the cornice and looked down on them.
The porch stopped with a jerk. They had reached the end of the
street. Anne’s heart stood still with anguish. One more moment and
they would be together no more.
Florian dropped the latch key. He fumbled slowly, very slowly with
his hand in the snow and never looked up once while doing so.
Thomas Illey bent to Anne:
“We cannot live any more without each other,” and he kissed her
hand.
Snow was falling slowly and through the snow-white veil they
looked silently into each other’s eyes.
When Anne walked up the stairs she took Thomas’s kiss with her
lips from her hand.
Next day she told her father all that had happened and when in
the afternoon the front door bell rang Florian opened the door with a
broad beaming face to Thomas Illey.
Anne heard his steps. The steps passed her door, along the
corridor, towards the green room.
Thomas Illey spoke little. His voice was serious and firm. John
Hubert listened to him standing and only offered him a seat when he
had finished.
“An honourable proposal....” This reminded him that he had used
the same words to Charles Münster. He laughed and then spoke out
conscientiously, as he had decided beforehand. He spoke of the loss
caused by the fire, of bad years of business. Of Anne’s dowry. His
voice became feeble:
“I am very sorry but I cannot withdraw any capital from the
business. The estate must remain undivided. This was decided by
my late father. I cannot depart from this.”
Illey waved his hand politely, disparagingly.
“This is not my affair. It concerns Miss Anne alone.”
John Hubert stared at him with undisguised astonishment. The
charm of the ancient name of Illey re-asserted itself on him: he no
longer leaned back in his armchair. He sat straight up solemnly and
felt sorry he had till now been so business-like.
“But what about the property of Ille,” he chose his words carefully,
“I understand that it is, unfortunately, in strange hands....”
Illey turned his head away. He realized that he had just been
showing off before the other and felt ashamed. This mild-eyed good
old business man reminded him of that which had attracted him at
first to Anne. It was no good denying it; in those times he thought
that the Ulwings were rich and that the ancestral property of Ille
might again become his own. He now tried to justify himself for
those old thoughts by the longing for the land of his forebears.
There was one hope. He thrust it aside.
John Hubert looked at him expectantly.
“Did Mr. Illey not think of buying the property back?”
Many a proud, disinterested word came to Illey’s mind. To rise
above everything, even above himself. To ask for nothing, only for
Anne whom he loved. He turned his sharp gentlemanly face to John
Hubert. He looked him straight in the eyes, as if making a vow:
“I think no longer of buying Ille back.”
John Hubert enquired politely after his family.
Thomas slowly turned the old seal ring on his finger. He began to
speak of his father. He died young of heart disease. His mother
followed him. Then the property got into the auctioneer’s hands.
Only a swampy wood remained. Nobody wanted that. And a little
money. He wanted to learn to work. This brought him to town. He
wanted to regain possession of the land through his own exertions.
Had it not given them their name, or had it not received its name
from them? However it was, the land of Ille and the Illeys had
belonged to each other for nearly a thousand years.
Thomas looked down wearily. He thought that the fate of the
Lord-Lieutenant’s grandchildren had overtaken him too.
“I studied law,” he said quietly, “like the rest of us; politics
absorbed me and I did not learn to work for money. That is in our
blood. It is only when work is done gratuitously that the Hungarian
nobility does not blush to work. Those of us who gave themselves
for money became bad men; the good ones were ruined.”
John Hubert nodded absent-mindedly. He was quite reassured
now that he had ascertained that Thomas Illey did not intend to
withdraw Anne’s dowry from the business. He proffered his hand to
him.
“It is settled. You do not think of buying Ille back. You won’t
meddle with the business. Now we can look at the ledgers and the
balance sheet.”
Thomas smiled. He wanted to see nothing but Anne, and John
Hubert opened the door of the sunshine room to him. There
everything was bright and warm.
When the new spring made earth and sky bright and warm around
the old house, Mamsell Tini stuck a wreathed veil into Anne’s hair.
Now, like a white cloud, the veil floated through the old rooms,
caressed the doors and walls. Anne kissed her father.
“Thank you, father,” said the girl. “I am so happy.”
Tears came into the eyes of John Hubert. Life had no more joys in
store for him....
In the corridor stood old Füger, and Mrs. Henrietta in a starched
bonnet, and Mr. Gemming. Poor little Feuerlein, deeply stirred, wiped
his eyes. None bowed more respectfully to Thomas Illey than Otto
Füger.
Above, high above the roofs, the bells clanged loud from the
church steeple of Leopold’s town, bells that had so often spoken of
the destinies of the Ulwings. And under the porch the two pillar-men
looked down into the flower-laden carriage.
The porch repeated once over the sound of the parting wheels,
then the house fell into silence. Anne carried her quiet laugh away
with her on her honeymoon. Everything became quiet, the men, the
days.
John Hubert was quite alone. A letter from Christopher, one from
Anne. He read them both many times over, smiled and shut his eyes.
Nowadays, he was always sleepy. He looked at the clock. Too early
to go to bed. He walked up and down in the quiet rooms.
From the green room the light of the lamp reached the dining
room. The sunshine room received light from a lamp in the street
which spread over the ceiling. The old nursery was quite dark.
John Hubert folded his hands behind his back and walked slowly
from darkness into light, from light into darkness. He thought of his
life. It had been like that too, but now that he looked back on it
there seemed to have been more darkness than light.
He could not understand what made him think of this just now
when his head was weary enough. For an instant he intended
sending for the doctor. Then he felt too tired to do it.
While he slowly turned the key in his watch, he felt giddy, yet he
put all the various objects from his pocket into the alabaster tray. His
keys, his penknife and the cigar case embroidered with beads. This
he carried as a habit, having renounced smoking several years ago.
Next day was Sunday. He did not get out of bed. From time to
time Tini came in to ask if he wanted anything. He opened his eyes,
nodded, but said nothing.
Gárdos, the physician, reassured him.
“It will pass away; it is only a little overwork,” and prescribed nux
vomica.
“No, you must not write to the children.”
During the week John Hubert was up. On Sunday he again stayed
in bed and felt better there. A letter came from Anne. He smiled at
it. So there was one person in the world who owed him her
happiness.... He smoothed his blanket down and turned to the wall.
A loud buzzing woke him at night. His head turned, the bed
turned, so did the room. And he breathed with difficulty. He wanted
to unbutton his shirt collar, but did not succeed. He sat up suddenly
and with his accustomed movement put his hand several times to his
neck as if to put his necktie right.
Then he fell back and moved no more.
That night John Hubert Ulwing died, correctly, without much ado,
just as he had lived.
CHAPTER XV
The house was empty and silence nestled between its walls. It was a
memorable event for the corridor to hear the sound of steps. The
ticking of the marble clock resounded through all the rooms, no
noise impeding its progress.
Thus did Anne find the house when she came back with her
husband from the interrupted journey which was to remain in her
memory like a broken dream.
Days without thoughts. Gentle words. Pure, girlish fears. Then she
became accustomed to Thomas’s embraces. The news of her father’s
death roused her and she could dream her dream no more. It was
gone for ever. Another came.
Real life took its place and the first year passed away.
Slowly the peace of the old house became bright again. Now and
then the rooms began to laugh timidly. They stopped suddenly,
ashamed of themselves, as if remembering those who had left by
the door never to come back again.
Another year went by.
The yellow walls of the old house were warm in the sun. In the
garden the beds put forth blossom-laden rosebushes, climbing
garlands of roses.
The rooms now laughed freely with the rippling laughter of a child.
And the house smiled to itself, like some good old patriarch who has
regained youth.
At that time Anne sang some wonderful little songs. She had
never learned them, they came of themselves and their soothing
rhythm was like the rocking of a cradle. Then she lifted her son with
that mysterious movement, which is more exalted than the gesture
of love, a movement secretly known by her arms long ago. And she
thought that it was this that linked all humanity. An endless, blessed
chain, a chain wrought of women’s arms over the earth, beginning
with the first woman and to end with the last child.
“Mamma,” babbled little George. Anne repeated in whispers the
word which was bestowed on her, which she herself had never
uttered to her mother; she looked at the fading portrait of Mrs.
Christina. She began to listen. The street door opened. Steps came
along the corridor....
“Thomas, I was longing for you!” She would have liked to say
more, something warmer. She wanted to tell him her love, but the
words were bashful and changed as they crossed her lips. She
leaned towards her husband, ready to be kissed.
Illey did not notice it; he was thinking of something else. He
began to read a letter.
“From home....”
“From home?... Is not this your home?” Anne’s head, held till now
sideways in a listening attitude, rose slowly.
Thomas saw nothing, heard nothing when Ille was in question.
Everybody, the old steward, the bailiff, the agent, the priest,
anybody who was in difficulties, came to him, as if he were still the
landlord. He did their errands and his eyes shone when he spoke of
them.
Anne looked at him motionless. A feeling came over her of which
she could never rid herself whenever Thomas spoke of Ille. It
seemed to her that her husband abandoned her and went far away
to some other place.
“Thomas,” she whispered, as if to recall him.
Illey smiled inattentively. He was still reading the letter. Anne’s
face became grave and cold. The tenderness which had till then
flowed bootlessly from her shrank back painfully into her heart.
“No, don’t go away. Come here. Read this....”
But Anne would not go nearer him. She held her head rigidly
erect. After the vain inclination to tenderness she hoped to regain
the balance in this way.
“It doesn’t matter, Thomas,” and animosity sounded in her voice,
“after all I don’t know those people of yours.”
“Why do you speak like that?” He looked at her reproachfully.
Again Anne’s voice baffled the hope in his soul, with which he
thought of Ille, which still gained, against his will, the upper hand
over him.... If he were to tell her everything, if he explained to her
that everything belonging to Ille was grown to his heart, that he was
craving for his land ... would she understand? The words shaped
themselves so intensely in his mind that he nearly heard them
sound. But they seemed abasing, as if they were begging. He felt
that he could never utter them.
In that moment Anne saw her husband’s countenance hard and
frigid.
“Why are you angry, Thomas?” Her eyes wandered to the letter
from Ille. “Don’t you understand? It will all be empty talk. All this is
so strange to me.”
“You are right!” Illey gave a short reproachful laugh. It dawned on
him suddenly that Anne was strange to all that which lived so vividly
in his blood and his past. Strange, and perhaps she wanted to
remain so.
While they were silent it seemed to both of them that they had
drawn further apart from each other, though neither of them had
moved. Then it was Thomas who turned away. Anne looked after
him.
In the beginning, when they could not understand each other,
they forgot it in an embrace. Later on, the weak, helpless cry of a
baby in the next room was enough to remove everything from their
minds and to make them run to it side by side; before they had
reached the door they had grasped each other’s hands.
On this occasion each of them remained alone. The words he had
spoken weighed cold on Anne’s memory; those he had kept back
made her anxious. She played with her little son absent-mindedly.
She fumbled idly in her work-table’s drawers. She gave that up too.
She wanted to go to her husband, lean her head against his
shoulders, and ask and answer till there remained nothing between
them that was obscure and uncertain.
But Thomas had visitors. From the green room the voice of
gentlemen reached the dining room and the smoke of their pipes
pervaded the place. They talked of the reconciliation of the King and
the country, of the coronation, of those who performed it, of
Parliament, of great national transformations.
Since the constitution had been re-established, Illey had entered
the service of the State; he worked in the Ministry of Agriculture.
Anne heard him in the adjoining room make some remarks on
intensive culture.
How coolly and intelligently Thomas spoke, while her own heart
was still heavy and sore. Suddenly her husband’s laughter reached
her ears through the closed door. Her eyebrows stiffened and
straightened, as if she had been hurt....
It was about this time that Thomas Illey began to go shooting
more often. His friends who owned property in the country invited
him. Down there in Ille, in his swampy wood, game was plentiful.
When he was free from his office he took his gun and was off. Then
he came home again happy, with a sunburnt face.
In the green room arms stood in the old cupboard where Ulwing
the builder used to keep his plans. Above the couch the portrait of
the architects Fischer von Erlach and Mansard were replaced by
English prints of hunting scenes. Cartridges were kept in the small
recesses of the writing table with the many drawers. A finely
wrought hunting knife lay in front of the marble clock.
Anne sometimes felt that Thomas did not love the old house or
the green room or the cosy, well-padded good old furniture.
“I say, Anne, these chairs here stand round the table like fat
middle-class women in the market. They hold their arms akimbo and
are nearly bursting with health.”
He laughed quietly.
“Is it possible you cannot see how funny they are? At home, in
Ille, there is a similar armchair in the nursery. We called it ‘Frau
Mayer’ and put a basket on its arm.”
Anne blushed a little and, disconcerted, looked at the chequered
linen covers.
“They insult us,” she said, as if speaking to the armchair, “though
we belong together....” She thought suddenly of the staircase in the
Geramb house, of Bertha Bajmoczy ... the old indignity ... the old
resentment. Then, as if her grandfather’s voice echoed in her
memory, “I am a free citizen.”
She raised her head. Her young neck bent back disdainfully.
“How beautiful you are, like this,” said Thomas and his voice
altered.
The woman’s shoulder trembled. That was the old voice that
thrilled her like a touch. They looked at each other for a moment
and then she disappeared in Thomas’s embrace.
Anne felt that in her husband’s arms all her cares vanished, that
she herself passed away. Her head fell back, no longer with pride
but with that feminine movement which expresses the conquest of
the conqueror.
“My love....”
They held each other for a long time tightly embraced and the
silence of rare and secret reunions came over them. When the
silence broke, the reunion was ended and they both withdrew into
themselves.
Later in the day, Anne came running through the rooms with a
telegram and joy rang in her voice:
“From Christopher!”
“Is he still in Baden-Baden?” sneered Thomas.
“He is coming to-night.”
“It is time....”
Anne cast her eyes down sadly. She always felt some irritation in
Thomas’s voice when he spoke of Christopher and that pained her. It
was true that since their father’s death Christopher had travelled a
great deal, but Otto Füger sent him regular reports and when he
was home he worked.
Business must have been excellent. There was more luxury in the
house than ever. Christopher had replaced the old boards by parquet
flooring. Carpets were laid on the stairs and two pairs of horses
stood in the stable. A manservant served at table in Netti’s place.
Florian opened the gate in livery. Anne received as much money as
she liked for housekeeping, that was all she understood. But if
Thomas was not content, why did he keep silent? Surely it would
have been his duty to look through the business books. Why did he
shrink from it?
Anne believed that he despised the business and, as in her mind
the business and the name of Ulwing were inseparable, she felt
affronted by her husband’s aloof indifference. In the beginning, she
had frequently raised the question with Thomas. He always
maintained a repelling silence.
She turned to him, but her husband, as if divining her thoughts,
anticipated her.
“Let us leave that alone, darling. I won’t interfere with the affairs
of the Ulwing business.” He thought of what her father had told him
when he asked for his daughter’s hand. A man must keep his word
even if he has not given it formally. He put his arms out and drew
his wife onto his knee.
“Let us stay together. I have to leave to-night, I am going
shooting to-morrow.”
Anne put her arms round Thomas’s neck. However much she
desired it, she would not ask her husband in words not to go away
from her. But to-day she knew something that was sure to retain
him. She smiled into his face.
“Do you know what day to-morrow is?”
Thomas became cheerful.
“Of course, Sunday. I can go to shoot.”
“The third anniversary of our wedding,” whispered Anne.