In all my Beginning books, my objective is to minimize what, in my judgment, are the three main hurdles the aspiring programmer must face: getting to grips with the jargon that pervades [r]
(1)(2)Beginning Java 2, SDK 1.4 Edition
by Ivor Horton ISBN:0764543652
Wrox Press • • 0 (1156 pages)
This book outlines everything the beginning programmer needs to know to program with the Java programming language and the 1.4 Java Developer Kit With the release of JDK 1.4, programmers can look forward to achieving better performance than ever
Table of Contents
Beginning Java 2, SDK 1.4 Edition Ch
apt er
- Introducing Java
Ch apt er
- Programs, Data, Variables, and Calculation
Ch apt er
- Loops and Logic
Ch apt er
- Arrays and Strings
Ch apt er
- Defining Classes
Ch apt er
- Extending Classes and Inheritance
Ch apt er - Exceptions Ch apt er
- Understanding Streams
Ch apt er
- Accessing Files and Directories
Ch apt er 10
- Writing Files
Ch apt er 11
- Reading Files
Ch apt er 12
- Serializing Objects
Ch apt er 13
- Collection Classes
Ch apt er 14
- A Collection of Useful Classes
Ch apt er 15 - Threads Ch apt er 16
- Creating Windows
Ch apt er 17
- Handling Events
Ch apt er 18
- Drawing in a Window
Ch apt er 19
- Extending the GUI
Ch apt er 20
- Filing and Printing Documents
Ch apt er 21
- Java and XML
Ch apt er 22
- Creating and Modifying XML Documents
Ap pe ndi x A - Keywords Ap pe ndi x B
- Computer Arithmetic
Ind ex of
- Data types, Keywords and Operators
Ind ex of
(3)Beginning Java 2, SDK 1.4 Edition
Ivor Horton Wrox Press Ltd đ
â 2002 Wrox Press
All rights reserved No part of this book may be reproduced, stored in a retrieval system or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations
embodied in critical articles or reviews
The author and publisher have made every effort in the preparation of this book to ensure the accuracy of the information However, the information contained in this book is sold without warranty, either express or implied Neither the authors, Wrox Press, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book
Published by Wrox Press Ltd,
Arden House, 1102 Warwick Road, Acocks Green, Birmingham, B27 6BH, UK
Printed in the United States
ISBN 1-861005-69-5
Trademark Acknowledgements
Wrox has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals However, Wrox cannot guarantee the accuracy of this information
Credits
(4)Ivor Horton Steve Baker
Robert Chang
Technical Editors Phil Powers De George
Mankee Cheng Justin Foley
Shivanand Nadkarni David Hudson
Girish Sharangpani Jim MacIntosh
Roberts Shaw Craig McQueen
Andrew Tracey Karen Ritchie
Gavin Smyth
Commissioning Editors John Timney
Louay Fatoohi David Whitney
Chanoch Wiggers
Index Production Coordinator
John Collins Natalie O'Donnell
Andrew Criddle
(5)Project Manager Pippa Wonson
Emma Batch Rachel Taylor
Proof Readers Cover Design
Lisa Stephenson Chris Morris
Fiona Berryman
Agnes Wiggers
Keith Westmooreland
Cover photograph by John Wright Photography, Warwick
A Note from the Author
In all my Beginning books, my objective is to minimize what, in my judgment, are the three main hurdles the aspiring programmer must face: getting to grips with the jargon that pervades every programming language and environment, understanding the use of the language elements (as opposed to what they are), and appreciating how the language is applied in a practical context
Jargon is an invaluable and virtually indispensable means of communication for the competent amateur as well as the expert professional, so it can't be avoided My approach is to ensure that the beginner understands what the jargon means and gets comfortable with using it in context In that way, they can use the documentation that comes along with most programming products more effectively, and can also feel competent to read and learn from the literature that surrounds most programming languages
Comprehending the syntax and effects of the language elements are obviously essential to learning a language, but I believe illustrating how the language features work and how they are used are equally important Rather than just use code fragments, I always try to provide the reader with practical working examples that show the relationship of each language feature to specific problems These can then be a basis for experimentation, to see at first hand the effects of changing the code in various ways
The practical context needs to go beyond the mechanics of applying individual language elements To help the
beginner gain the competence and confidence to develop their own applications, I aim to provide them with an insight into how things work in combination and on a larger scale than a simple example with a few lines of code That's why I like to have at least one working example that builds over several chapters In that way it's possible to show
(6)StartDocument(), 1033
StartElement(), 1033
StartPrefixMapping(), 1034, 1041
startsWith(), 147, 153, 368
stateChanged(), 883
stop(), 602, 721
stringWidth(), 670
subList(), 514
substring(), 155, 157
sum(), 705
synchronizedList(), 638, 640
tan(), 59
Thread(), 604
toArray(), 515
toCharArray(), 159
toDegrees(), 60
toLowerCase(), 150
toRadians(), 60
toString(), 141, 167, 212, 244, 253, 254, 256, 267, 276, 346, 361, 367, 437, 518, 527, 529, 530, 1057, 1061,
1063, 1081
toUpperCase(), 151
transferFrom(), 450, 451, 455
transferTo(), 450, 451, 455
translate(), 658, 659, 904, 961, 965
trim(), 159
trimToSize(), 511
tryLock(), 466, 467, 469
union(), 660
update(), 557, 560, 836, 899
validatePage(), 977
valueChanged(), 879, 880
valueOf(), 141, 299, 348
values(), 537, 538
wait(), 253, 632, 633, 636
warning(), 1042, 1056
whitespaceChars(), 341
windowActivated(), 738, 951
windowClosed(), 738, 951
windowClosing(), 738, 742, 951
windowDeactivated(), 738, 951
windowDeiconified(), 738, 951
windowGainedFocus(), 738
windowIconified(), 738, 951
windowLostFocus(), 738
windowOpened(), 738, 951
windowStateChanged(), 738
wordChars(), 341
wrap(), 428, 1082
write(), 385, 403 5, 424, 456, 1082
writeByte(), 476
writeBytes(), 477
writeChar(), 476
writeChars(), 477
writeDouble(), 476, 932
(7)writeInt(), 476
writeLong(), 476
writeObject(), 47577, 480, 481, 488, 489, 932
writeShort(), 476