- Shopping Bag ( 0 items )
What is this book about?
The Java language has been growing from strength to strength since its inception in 1995. It has since proved to be both powerful and extraordinarily easy to learn and use. This is what makes it ideal for the beginner. With dramatic changes to the handling of files, and the introduction of native support for XML, Java has been updated to work faster and to be current with the incredible rise of XML as a medium for ...
What is this book about?
The Java language has been growing from strength to strength since its inception in 1995. It has since proved to be both powerful and extraordinarily easy to learn and use. This is what makes it ideal for the beginner. With dramatic changes to the handling of files, and the introduction of native support for XML, Java has been updated to work faster and to be current with the incredible rise of XML as a medium for communicating data.
This edition of the Beginning Java books outlines everything the beginning programmer needs to know to program with the Java programming language and the 1.4 Java Developer Kit (JDK). With the release of JDK 1.4, programmers can look forward to the most stable edition yet, and even better performance than was available previously.
Over the course of the book, you will build an example application called Sketcher — a simple drawing tool — that teaches you how to build an interactive user interface with Java, how to save and open files, how to use color, and how to respond to user input.
What does this book cover?
Who is this book for?
Ivor's inimitable style has proved to be a hit with nearly half a million people with its easy to learn approach and the many useful examples. Regularly voted the most popular Javaprogramming book, this book teaches Java from scratch and assumes no previous knowledge. It is also suitable for those who have got some programming experience, especially C or C++, which will make learning easier.
Programmers will find this tutorial a quick and easy way to learn Java. Author Ivor Horton provides extensive amounts of information, from language terms to hands-on code demonstrations. Although this book does not include a trial version of the JDK 1.2, it does include step-by-step instructions for all the software tools that accompany it.
In this chapter you will learn:
What is Java All About?
Java is an innovative programming language that first of all enables you to write programs called applets that you can embed in Internet Web pages. Java also allows you to write applications programs that you can run normally on your, or indeed any, computer that supports the language. You can even write programs that will work as an ordinary application and as an applet. Because Java has matured so much recently, it is becoming the language of choice for applications that need to run on a variety of different computer systems.
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 unlimited.
Beginning Java 2
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 creating code with malicious intent is effectively inhibited. Java implicitly incorporates measures to minimize the possibility of such occurrences.
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 will run unchanged on an); 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 require the source code to be tailored to each individual computer to accommodate the particular idiosyncrasies of that machine and operating system.
Possibly the next most important characteristic of Java is that it is object oriented. The objectoriented 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 manages to avoid many of the difficulties and complications that are inherent in some other object-oriented languages, so you will find it very straightforward and easy to learn.
Java is not difficult, but there is a great deal to it. The language itself is quite 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. Each chapter, as far as possible, 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 you drowning is minimized, and there is a high expectation that you will end up a competent swimmer.
As we have already noted, there are two kinds of programs you can write in Java. Programs that are to be embedded in a Web page are called Java applets, and ordinary standalone programs are called Java applications. You can further subdivide Java applications into console applications, which only support character output to your computer screen (in a DOS window on a PC under Windows, for example) and windowed Java applications that can create and manage multiple windows, and use the typical graphical user interaction (GUI) mechanisms of window-based programs.
While you are learning the Java language basics, we will be using console applications as examples to illustrate how things work. This is because we can then focus on the specifics of the language, without worrying about any of the complexity involved in creating and managing windows. Once you are comfortable with using all the features of the Java language, we'll move on to windowed applications and applet examples.
Learning Java - the Road Ahead
Before starting out, it is always helpful to have an idea of where you are heading and what route you should take, so let's take a look at a brief road map of where you will be going with Java. There are five broad stages you will progress through in learning Java using this book:
1. The first stage is this chapter. It sets out some fundamental ideas about the structure of Java programs and how they work. This includes such things as what objectoriented programming is all about, and how an executable program is created from a Java source file. Getting these concepts straight at the outset will make learning to write Java programs that much easier for you.
2. Next you will learn how statements are put together, what facilities you have for storing basic data in a program, how you perform calculations and how you make decisions based on the results of them. These are the nuts and bolts you need for the next stages.
3. In the third stage you will learn about classes - how you define them and how you can use them. This is where you learn the object-oriented characteristics of the language. By the time you are through this stage you will have learnt all the basics of how the Java language works so you will be ready to progress further into how you can use it.
4. In the fourth stage, you will learn how you can segment your application into pieces that can execute concurrently. This is particularly important for when you want to include several applets in a Web page, and you don't want one applet to have to wait for another to finish executing, before it can start. You may want a fancy animation to continue running while you play a game, for example, with both programs sitting in the same Web page.
5. In the fifth stage you will learn in detail how you implement an application or an applet with a graphical user interface, and how you handle interactions with the user in this context. This amounts to applying the capabilities provided by the Java class libraries. As well as learning about GUI implementation, you will also learn about handling images in various ways, as well as using the database access facilities in Java. When you finish this stage you will be equipped to write your own fully-fledged applications and applets in Java. At the end of the book, you should be a knowledgeable Java programmer. The rest is down to experience....
|Chapter 1||Introducing Java||7|
|Chapter 2||Programs, Data, Variables and Calculation||33|
|Chapter 3||Loops and Logic||73|
|Chapter 4||Arrays and Strings||115|
|Chapter 5||Defining Classes||163|
|Chapter 6||Extending Classes and Inheritance||229|
|Chapter 8||Streams, Files and Stream Output||319|
|Chapter 9||Stream Input, and Object Streams||367|
|Chapter 10||Utility Classes||409|
|Chapter 12||Creating Windows||525|
|Chapter 13||Handling Events||599|
|Chapter 14||Drawing in a Window||657|
|Chapter 15||Extending the GUI||723|
|Chapter 16||Filing and Printing Documents||799|
|Chapter 17||Images and Animation||849|
|Chapter 18||Talking to Databases||901|
|Chapter 19||The JDBC in Action||959|
|Appendix A||Setting Up||1029|
|Appendix B||Java Archives - JAR files||1035|
|Appendix D||ASCII Codes||1045|
|Appendix E||Computer Arithmetic||1051|
Posted March 6, 2003
I wanted to learn Java, and I bought this book. It is great. I am a Microsoft Certified Professional with Visual Basic 6.0, so I am not new to programming. This is an awesome book, and I will definetely keep it for a reference. I couldn't ask for a better beginner book for Java.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted October 17, 2001
Posted April 11, 2001
A serious programming (Java) approach for beginners. However, most of the examples used are either unrealistic or just plain petty. Hence, you still don't get to appreciate the power of this language.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted December 26, 2000
I have been programming with Visual Basic for 5 years and I did not know any Java at all. I have found that although it seems to be a slow starting book it gives you an excellent foundation and builds on what you have learned in each chapter. If you want to learn Java by yourself then I really recommend this book, I have to learn Java for my job and so far this has been the best learning aid I have found. The explanations are clear and the examples are great and add to your understanding of the language.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted April 23, 2000
This book is great for beginners who really want to learn Java 2. It's very clear and it has great examples. This book is a bit wordy, but its all worth it. Ivor Horton is a great author and I strongly suggest you buy this book. I've read many Java books, and this book is surely the Java 2 Bible.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted March 14, 2000
I have read several Java books. This one is by far the best. This book covers more material, more clearly then any other book that I have seen. I have read other Ivor Horton books, including the Beginning C++ and Beginnig Visual C++ books. All of them are exceptional and would recommend them to anyone. These books are very good for people who really want to learn a programming language and not just a few flashy things to put on a web page.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted February 11, 2000
I just started working with Java AND computers. I'm finding the book extremely useful, not only with the language, but also with the download,install, and placement of files in the JDK. It's very thorough, which may be boring for an experienced programmer, but is great for an unseasoned beginner like myself.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.
Posted December 25, 1999
This Book teaches you step-by-step how to program in JAVA. If you have experience in C,C++ or VB you may find this book boring. I did. I would recomend another book if you have experience in programming.Was this review helpful? Yes NoThank you for your feedback. Report this reviewThank you, this review has been flagged.