Java Pocket Guide 1st Edition Liguori Download PDF
Java Pocket Guide 1st Edition Liguori Download PDF
https://ebookgate.com
https://ebookgate.com/product/java-pocket-
guide-1st-edition-liguori/
https://ebookgate.com/product/scja-sun-certified-java-associate-study-
guide-exam-cx-310-019-certification-press-1st-edition-robert-liguori/
ebookgate.com
https://ebookgate.com/product/pocket-rough-guide-paris-rough-guide-
pocket-guides-ruth-blackmore/
ebookgate.com
https://ebookgate.com/product/echocardiography-pocket-guide-bernard-
bulwer/
ebookgate.com
https://ebookgate.com/product/pocket-guide-to-knots-lindsey-philpott/
ebookgate.com
The JavaScript Pocket Guide 1st Edition Lenny Burdette
https://ebookgate.com/product/the-javascript-pocket-guide-1st-edition-
lenny-burdette/
ebookgate.com
https://ebookgate.com/product/pocket-guide-to-radiation-oncology-1st-
edition-daniel-chamberlain/
ebookgate.com
https://ebookgate.com/product/java-studio-creator-field-guide-
anderson/
ebookgate.com
https://ebookgate.com/product/linux-pocket-guide-2nd-edition-daniel-j-
barrett/
ebookgate.com
https://ebookgate.com/product/the-nintendo-wii-pocket-guide-1st-
edition-bart-g-farkas/
ebookgate.com
www.it-ebooks.info
www.it-ebooks.info
Java ™
Pocket Guide
www.it-ebooks.info
www.it-ebooks.info
Java ™
Pocket Guide
www.it-ebooks.info
Java™ Pocket Guide
by Robert Liguori and Patricia Liguori
Copyright © 2008 Robert Liguori and Patricia Liguori. All rights reserved.
Printed in Canada.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles
(safari.oreilly.com). For more information, contact our corporate/
institutional sales department: (800) 998-9938 or corporate@oreilly.com.
Printing History:
March 2008: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are
registered trademarks of O’Reilly Media, Inc. The Pocket Guide series
designations, Java Pocket Guide, the image of a Javan tiger, and related trade
dress are trademarks of O’Reilly Media, Inc.
Java™ and all Java-based trademarks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc., in the United States and other countries.
Many of the designations used by manufacturers and sellers to distinguish
their products are claimed as trademarks. Where those designations appear
in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the
designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the
publisher and authors assume no responsibility for errors or omissions, or
for damages resulting from the use of the information contained herein.
ISBN: 978-0-596-51419-8
[TM]
www.it-ebooks.info
Contents
Preface xi
Part I. Language
www.it-ebooks.info
Separators 10
Operators 10
Literals 12
Escape Sequences 15
Unicode Currency Symbols 15
vi | Contents
www.it-ebooks.info
Static Data Members, Static Methods, and Static Constants 44
Interfaces 46
Enumerations 46
Annotations Types 47
Contents | vii
www.it-ebooks.info
Part II. Platform
viii | Contents
www.it-ebooks.info
Chapter 13: Generics Framework 114
Generic Classes and Interfaces 114
Constructors with Generics 115
Substitution Principle 115
Type Parameters, Wildcards, and Bounds 116
The Get and Put Principle 117
Generic Specialization 118
Generic Methods in Raw Types 119
Contents | ix
www.it-ebooks.info
Chapter 17: Third-Party Tools 142
Development Tools 142
Libraries 144
IDEs 144
Web Application Platforms 145
Scripting Languages 147
Index 159
x | Contents
www.it-ebooks.info
Chapter 1
Preface
Book Structure
This book is broken into two sections: language and plat-
form. Chapters 1 through 8 detail the Java programming lan-
guage as derived from the Java Language Specification (JLS).
Chapters 9 though 18 detail Java platform components and
related topics.
xi
www.it-ebooks.info
Font Conventions
Italic
Denotes filenames, file extensions (such as .java), and
directory paths.
Constant width
Denotes class names, types, methods, data members,
commands, properties, and values.
Constant width italic
Indicates user-supplied values.
xii | Preface
www.it-ebooks.info
Authors
Robert Liguori is a Senior Software Engineer for Management,
Engineering and Technology Associates, Inc. Patricia Liguori is
a Lead Information Systems Engineer for The MITRE Corpora-
tion. The authors may be contacted in regards to comments,
questions, or errata found in this book at jpg@gliesian.com.
Acknowledgments
We extend a special thank you to our editor, Mike Loukides.
His Java prowess, responsiveness, and ongoing collaboration
have made writing this book an enjoyable experience.
Appreciation goes out to our technical reviewers and sup-
porters: Mary-Ann Boyce, Kelly Connolly, Edward Finegan,
David Flanagan, David King, Chris Magrin, Confesor Santi-
ago, Wayne Smith, Martin Suech, and our families.
Dedication
This book is dedicated to our daughter, Ashleigh.
Preface | xiii
www.it-ebooks.info
www.it-ebooks.info
PART I
I. Language
www.it-ebooks.info
www.it-ebooks.info
CHAPTER 1
Naming Conventions
Class Names
Class names should be nouns, as they represent “things” or
“objects.” They should be mixed case with only the first let-
ter of each word capitalized.
public class Fish {...}
Interface Names
Interface names should be adjectives. They should end with
“able” or “ible” whenever the interface provides a capability;
otherwise, they should be nouns. Interface names follow the
same capitalization convention as class names.
public interface Serializable {...}
public interface SystemPanel {...}
Method Names
Method names should contain a verb, as they are used to
make an object take action. They should be mixed case,
beginning with a lowercase letter, and the first letter of each
www.it-ebooks.info
internal word should be capitalized. Adjectives and nouns
may be included in method names.
public void locate( ) {...} // verb
public String getWayPoint( ) {...} // verb and noun
www.it-ebooks.info
Another random document with
no related content on Scribd:
His Excellency D. Petkoff,
Prime Minister of Bulgaria.
The sitting was a historic one in the annals of Bulgaria, and ere
the applause had died away, the President, on the red-carpeted
platform, rang his gong violently, and called upon the newly
appointed Minister of Foreign Affairs to make his declaration upon
Bulgaria’s future policy.
Dr. Stancioff, who until recently was Bulgarian diplomatic agent in
St. Petersburg, rose from his seat at the Ministers’ table—a dark,
good-looking, middle-aged man—a trifle nervous perhaps at
addressing the Chamber for the first time in his new position.
A dead silence followed. Bulgaria awaited the statement with
breathless eagerness. They had heard the Premier’s declaration
regarding Macedonia. What would the Foreign Minister say?
The blue-uniformed attendants took up their positions against the
dead white panelling of the Chamber, lending the necessary colour
to complete the picturesqueness of the scene, while the great arc
lamps hissed above as they shed their bright white light over the
rows of deputies upon the horseshoe benches. On the wall, straight
before the Ministers’ table, the burnished gold of the holy ikon shone
to remind them of their duty to the Almighty and to the nation. For a
few moments all was silent.
Then Dr. Stancioff, the new man of Bulgaria, cleared his throat,
and in Bulgar made the following clear, deliberate, and concise
statement, of which the following is a translation. It is, as will be
seen, a direct pronunciation of foreign policy—a firm policy, which
may very probably mean war with Turkey at a no distant date.
Indeed, war is in the air in Bulgaria, and over the Macedonian
question may come at any moment; therefore the Minister’s actual
words may, with advantage to the future, be repeated here.
He said—
“Gentlemen, the Minister President has just given an ample
exposition of the policy the Government has followed up to the
present moment, and the course which it has marked out for itself
for the future: on this point, therefore, there is but little left for me
to say, as a member of this Government, and as one who is willing
to bear the responsibility of his acts before this honourable
Assembly.
“Under these circumstances, if I speak, it is chiefly that my silence
may not give rise to misinterpretation, and in order to underline the
words my colleague has said.
“Without doubt, you remember, gentlemen, that I have held the
post of Foreign Minister only a few days, and I am under no
obligation to enter into any explanation of the policy followed before
my nomination, and on the debates, interpellations, and the opinions
that it has called forth. Therefore I shall limit myself to saying a few
words on the policy that we are going to follow for the future.
“There are two questions I wish to discuss. Firstly, our relations
with the Great Powers; and secondly, what is to be our policy in
regard to what I must call the question of questions—Macedonia.
“First of all, I am glad to be able to state that our relations with
the Great Powers are of the best.
“This fact is always being confirmed by the notifications which we
receive from abroad.
“By the line of peaceful development which she has traced for
herself, and which she has never ceased to pursue, by the
honourable manner in which she fulfils all her international
engagements, and by the clear comprehension which she has of her
position in the Balkans, Bulgaria is gaining more and more the
sympathy and esteem of the Great Powers.
“It would be superfluous to mention in detail our relations with
each separate State. Nevertheless, I wish to point out the happy fact
that as to what concerns our relation with Russia—the Liberating
Power—they are what they ought to be when one considers the ties
which bind us to her, when one considers the ties which unite the
two Slav people, and when one considers all that Bulgaria owes to
Russia. Our relations with Russia are of the best, and it will always
be the Government’s endeavour to render them even more cordial.
“Economic as well as political considerations bind us to Austria-
Hungary. These interests compel us to maintain relations as cordial
as possible with this Great Power.
“Our friendship with Germany, England, France, and Italy is dear
to us. We greatly appreciate the sympathy of which these countries
have given us so many proofs, and it will be our care, guided by the
interests of our country, to consolidate and ameliorate these
relations.
“As regards our relations with the neighbouring States, I assert
that those with Roumania are, as they ought to be, the best and the
most cordial. We appreciate at its true value our sincere friendship
with Roumania, and it will be our task to preserve it.
“Our relations with Servia are good. We desire to cultivate a
neighbourly policy with this State. It is a policy suited to two sister
nations, and we shall cultivate it in accordance with the point of view
that Bulgaria has cultivated for so long. I may add that, to gain this
end, we shall do all that is in our power.
“As to our relations with Montenegro, it suffices to say that ancient
sympathies, the reciprocity of which has never been denied, bind us
to this State. Our sympathies perpetuate the nature of these
relations with our valiant sister nation, and assure us that they can
only be good and cordial.
“From a diplomatic point of view, our relations with Greece are
good and normal; the regrettable incidents which took place last
summer in certain portions of our country belong to the Department
of the Interior. They are, so to speak, a family matter; they cannot,
and must not, be allowed to darken relations between the two
countries, who in their common interests will guard against a
modification so undesirable.
“There only remains for me to speak of our relations with Turkey.
“I will be brief, though I could speak at great length upon this
subject.
“Our relations can only be good, or sincerely good. At the present
moment they are only ‘good.’ Before they can become ‘sincerely’
good it is necessary that the two countries should be convinced not
only of the utility of friendly relations, but also that their interests,
political and economic, demand other relations than those that exist
at the moment. As regards ourselves, who take this matter at its
true valuation, it will be our task to do our utmost to prove to Turkey
that we justly estimate these interests, and are prepared to pursue a
sincere policy, provided that, on her side, she gives us pledges of her
reciprocity.
“You will be able to estimate what that policy is by the attitude
that we have taken up regarding the Macedonian question. This is a
European question, but that does not hinder it from being, at the
same time, both a Bulgarian and a Turkish question. First of all, I
declare that the Bulgarian Government is far from having conceived
the idea of provoking or imposing a solution of the Macedonian
question by violent means. But our Government recognises the
significance of this vital question for our country, it justly estimates
the violence with which this question reflects itself upon the inner
life of the Principality, and this renders it necessary to closely
observe its development and its solution.
“The Macedonian question is in the hands of the Great Powers,
who have taken upon themselves the task of introducing into
Macedonia reforms assuring to the population of this country a
development at once more orderly and more free. It is true that in
this respect up to the present an altogether satisfactory result has
not yet been achieved, and that the Bulgarian population of
Macedonia and the vilayet of Adrianople still have to face
complications. But the Government hopes that the good work they
have begun will make progress. The Government will take every
measure to keep itself currently informed of the situation in
Macedonia, and will do everything in its power to at all times assist
the interested Governments, and insist with all its energy upon the
amelioration of the condition of the people of this country. The
Government think that the representation they are going to make to
the Great Powers in regard to a prompter and more energetic
carrying out of the essential reforms in Macedonia is not
incompatible with having good and cordial relations with Turkey. On
the contrary, they consider that action of this nature suggests a
more normal conception of the reciprocal interests of the two
countries, and that it will induce the Government of His Majesty the
Sultan to adopt a totally different attitude in regard to the Bulgarian
population of Macedonia—an attitude which will conduce to its
peace, and which will be, at the same time, an important factor in
the destinies of the Empire itself.
Military Manœuvres in Bulgaria.