Beginning Java 2: JDK 1.3 Version

Beginning Java 2: JDK 1.3 Version

by HORTON

Hardcover(2000)

$44.67 $49.99 Save 11% Current price is $44.67, Original price is $49.99. You Save 11%.

Product Details

ISBN-13: 9781861003669
Publisher: Apress
Publication date: 03/01/2000
Series: Programmer to Programmer Series
Edition description: 2000
Pages: 1268
Product dimensions: (w) x (h) x 0.10(d)

About the Author


After countless years in the computer industry both doing and managing, Ivor has taken up writing on programming topics for relaxation.

When not relaxing, he takes an interest in cosmology, cacti, chaos and cameras, and does a little editing of other people's efforts on the side.

Read an Excerpt


Chapter 1: Introducing Java

This chapter will give you an appreciation of what the Java language is all about. Understanding the details that we'll introduce in this chapter is not important at this stage; you will see all of them again in greater depth in later chapters of the book. The intent of this chapter is to introduce you to the general ideas that underpin what we'll be covering through the rest of the book, as well as the contexts in which ,Java programs can be used and the kind of program that is applicable in each context.

In this chapter you will learn:

  • The basic characteristics of the Java language.
  • How Java programs work on your computer.
  • Why Java programs are portable between different computers.
  • The basic ideas behind object-oriented programming.
  • How a simple Java program looks and how you can run it using the Java Development Kit.
  • What HTML is and how it is used to include ajava program in a Web page.

What is Java All About?

Java is an innovative programming language that is becoming the language of choice for programs that need to run on a variety of different computer systems. First of all Java enables you to write small programs called applets. These are programs that you can embed in Internet Web pages to provide some intelligence. They might simply display an animated logo, or support data entry of some kind. Java also allows you to write large-scale application programs that you can run normally on any computer that supports the language. You can even write programs that will work both as ordinary applications and as applets. Java has matured immensely over the past couple of years, particularly with the introduction of Java 2. The breadth of capability provided by the standard core Java has grown incredibly, with the latest release extending into sampled sound and MIDI data processing.

Being able to embed executable code in a Web page introduces a vast range of exciting possibilities. Instead of being a passive presentation of text and graphics, a Web page can be interactive in any way that you want. You can include animations, games, interactive transaction processing - the possibilities are almost unlimited.

Of course, embedding program code in a Web page creates special security requirements. As an Internet user accessing a page with embedded Java code, you need to be confident that it will not do anything that might interfere with the operation of your computer, or damage the data you have on your system. This implies that execution of the embedded code must be controlled in such a way that it will prevent accidental damage to your computer environment, as well as ensure that any Java code that was created with malicious intent is effectively inhibited. Java implicitly incorporates measures to minimize the possibility of such occurrences arising with a Java applet.

Aside from its ability to create programs that can be embedded in a Web page, perhaps the most important characteristic of Java is that it was designed from the outset to be machine independent. Java programs can run unchanged on any computer that supports Java. Of course there is still the slim possibility of the odd glitch as you are ultimately dependent on the implementation of Java on any particular machine, but Java programs are intrinsically more portable than programs written in other languages. An interactive application written in Java will only require a single set of source code, regardless of the number of different computer platforms on which it is run. In any other programming language, the application will frequently require the source code to be tailored to accommodate different computer environments, particularly if there is an extensive graphical user interface involved.

Possibly the next most important characteristic of Java is that it is object oriented. The object-oriented approach to programming is also an implicit feature of all Java programs, so we will be looking at what this implies later in this chapter. Not only is Java object oriented, but it also manages to avoid many of the difficulties and complications that are inherent in some other object-oriented languages, making it very straightforward and easy to learn.

Learning Java

Java is not difficult, but there is a great deal to it. The language itself is fairly compact, but very powerful. To be able to program effectively in Java, however, you also need to understand the libraries that go with the language, and these are very extensive. In this book, the sequence in which you learn how the language works, and how you apply it, has been carefully structured so that you can gain expertise and confidence with programming in Java through a relatively easy and painless process. As far as possible, each chapter avoids the use of things you haven't learnt about already. A consequence, though, is that you won't be writing Java to be embedded in Web pages right away. While it may be an appealing idea, this would be a bit like learning to swim by jumping in the pool at the deep end. Generally speaking, there is good evidence that by starting in the shallow end of the pool and learning how to float before you try to swim, the chance of drowning is minimized, and there is a high expectation that you will end up a competent swimmer...

Table of Contents

Chapter 1: Introducing Java
Chapter 2: Programs, Data, Variables and Calculation
Chapter 3: Loops and Logic
Chapter 4: Arrays and Strings
Chapter 5: Defining Classes
Chapter 6: Extending Classes and Inheritance
Chapter 7: Exceptions
Chapter 8: Streams, Files and Stream Output
Chapter 9: Stream Input and Object Streams
Chapter 10: Utility Classes
Chapter 11: Threads
Chapter 12: Creating Windows
Chapter 13: Handling Events
Chapter 14: Drawing in a Window
Chapter 15: Extending the GUI
Chapter 16: Filing and Printing Documents
Chapter 17: Images and Animation
Chapter 18: Sound
Chapter 19: Talking to Databases
Chapter 20: The JDBC in Action
Appendix A: Setting Up
Appendix B: Java Archives - JAR Files
Appendix C: Creating Java Documentation
Appendix D: Keywords
Appendix E: ASCII Codes
Appendix F: Computer Arithmetic

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

Beginning Java 2: JDK 1.3 Version 4.2 out of 5 based on 0 ratings. 10 reviews.
freezotic on LibraryThing 21 days ago
As Java evolves Ivor Horton manages to keep up with new versions of this course in Java programming for beginners. I did the course as an autodidact, this took me half a year, and I learned a lot. I do think you have to be a bit of a beta to fully get into this. But then you'll learn the basics that you need in Java better than anywhere else. The 1.3 edition has a chapter about MIDI and sound that other editions dearly miss. I still use the book as a reference, though I have Flanagan's Java in a Nutshell on the shelve now too - which is more thorough but less educational.I suggest you buy the new version of the book, make the exercises at the end of each chapter, if you want to become a Java programmer!
Guest More than 1 year ago
I enjoyed this book. Though I must confess I didn't read absolutely every page. I still found much of it infomative.
Guest More than 1 year ago
i really think that this book is nothing but absurdity,the codes have bugs in them,the topics are not explained well.So please don't waste your time and precious money.
Guest More than 1 year ago
First, I must agree with the ones that said that this book is not for the complete novice. It IS a bit on the heavy side, both physically (1200+ pages) and mentally, and if you've never done any Java programming before, the first chapter is not the best introduction to Java. Two years ago, I was introduced to Java using Java for Students by Doug Bell, and although this book is applet rather than application oriented, it's the best intro book I know of. Later, I then struggled my way through Java Gently by Judy Bishop, because my Professor thought this was a good book. To me it was terrible, because of the radically different let-them-figure-out-the-code-by-themselves approach in that book. I hadn't done any Java for about a year and a half, when I desperately needed to recapture lost knowledge for some fairly advanced programming, and I browsed many books at no avail until I found this one. this is the absolutely best book on Java, if you need to learn workable code. 'Workable' here means a code that actually does something useful rather than just demonstrating a hypothetical example that is not related to real life. Most books introduce new examples for every new bit of code or give you fragments of code only. Java Gently is a typical example. Ivor doesn't do this. This makes learning easy. He uses the same example throughout the whole chapter, editing and revising as he adds new features. The chapter usually ends with a larger review and demonstration of all concepts from the chapter. Often the same example is used throughout many chapters. This is really step-by-step, every possible twitch and parameter is explored. Horton doesn't leave out anything. After reading the book, studying the examples and doing the exercises, there shouldn't be any doubt about how a particular piece of code works. With the companion website that offers downloadable code and a discussion forum, this book has a lot of 'add-ons'. If you need to have your Java project up and running fast, this book should help you make it happen in a matter of days. I wouldn't want to be without this book (p2p.wrox.com/java). It's a good idea to supplement this book with Java 2 The Complete Reference by Herbert Schildt (www.osborne.com). I also has downloadable code and tons of useful examples. Next comes Java 2 by Example by Geoff Friesen(www.quepublishing.com) that only covers JDK 1.2, but it has very nice introductory chapters. Finally, in the same series as Beginning Java 2, there is Beginning Java Objects, a book that teaches you how to build a full-fledged Java application from scratch. In a way it's like Beginning Java 2, but it uses the same case example to demonstrate Java programming, which makes it very easy to follow. It's a good idea to supplement this book with Java 2 The Complete Reference by H Schildt (www.osborne.com). I also has downloadable code and tons of useful examples, or the Java 2 Bible By A Walsh. Next comes Java 2 by Example by Geoff Friesen(www.quepublishing.com) that only covers JDK 1.2, but it has very nice introductory chapters. Finally, in the same series as Beginning Java 2, there is Beginning Java Objects, a book that teaches you how to build a full-fledged Java application from scratch. In a way it's like Beginning Java 2, but it uses the same case example to demonstrate Java programming, which makes it very easy to follow.
Guest More than 1 year ago
I've just starting reading the book and I'm learning alot. The examples are good and thoroughly explained. I only have a couple of knocks though. The use of learnt instead of learned is annoying. Also, the first six chapters could be about 10 pages shorter if all the references to what will be covered later were removed. All in all a good book for beginners and experienced programmers alike.
Guest More than 1 year ago
I just started reading the Beginning Java 2, 1.3 jdk version. I have been taking my second java class and the college I attend for the class insists on using the Deitel and Deitel book for java. I have been so absolutely lost by reading that gobbly-gook I almost gave up on learning java altogether! I just wanted to give a huge thumbs up on your book, Beginning Java 2! You definitely scope your writing to those of any programming experience level, whether complete novice or prior language saavy. I am now understanding the concepts of extending classes/inheritance, interfaces, abstract classes and methods, etc. that the Deitel book had confused me thoroughly with their writing method. I have looked at a lot of java books to end up with this one and I have to say this is absolutely the best book to learn java from that I have found. Just wanted to thank you for helping me stay interested in learning java!
Guest More than 1 year ago
Ivor Horton's Beginning Java 2 has become a cornerstone for folks who are just starting out to learn Java. As an adjunct faculty member at both George Washington University and Johns Hopkins University, I recommend Mr. Horton's book to my students as an excellent tutorial reference on Java language syntax. And, I am pleased to announce that Wrox Press Ltd. has recently published my book, Beginning Java Objects, as a companion book to Ivor's! Beginning Java Objects covers object concepts, object modeling, and Java programming all in one volume. It is designed for Java beginners who don't understand how to structure an application to take proper advantage of Java's object-oriented nature. For more information, please take a look at it online at BarnesAndNoble.com.
Guest More than 1 year ago
This book is a good starting to the Java world. It's not perfect, there are some topics that are not explained extensively, but it gives you a good reference point. It is well structured and didactic. I talked to my coworkers about this book and now 2 of them bought it.
Guest More than 1 year ago
This is a great book as it explains the Java complexity in a very easy to understand level. There are some topics that are not explained as well as should be, but the book is excellent overall. The book also has a web-site of which you can be a part of, in order to discuss the issues of the book and the Java Language. A must buy!
Guest More than 1 year ago
Easily one of the best books for TRUE beginners in Java. The material is still quite difficult, but Horton does a good job explaining it, unlike other Java beginner books (e.g., Bruce Eckel's Thinking in Java), many of which assume you already know about programming and/or C/C++ and are poorly edited. Far and away one of the best beginner java books around.