New Developments

This version of Learning Java is actually the fifth versionupdated and retitledof our original, popular Exploring Java. With each version we've taken great care not only to add new material covering additional features, but to thoroughly revise and update the existing content to synthesize the coverage and add years of real-world perspective and experience to these pages. One noticeable change in recent versions is that we've deemphasized the use of applets, reflecting their somewhat static role over the past couple of years in creating interactive web pages. In contrast, we've greatly expanded our coverage of server-side web apps and XML, which are now mature technologies. We cover all of the important features of the latest release of Java, officially called Java 2 Standard version 5.0, JDK 1.5. Sun has changed the naming scheme many times over the years and this is the most confusing release ever! Sun coined the term "Java 2" to cover the major new features introduced in Java Version 1.2 and dropped the term JDK in favor of SDK. With this release Sun has skipped from Java Version 1.4 to the Java 5.0, but reprieved the term JDK and kept its numbering convention there. We've had no choice but to accept the term Java 5.0 into our vocabulary. You can't fight marketing. This release of Java is targeted at developers and has the biggest set of language changes since Java's birth. We've tried to capture these new features and update every example in this tutorial to reflect not only the current Java practice, but style.

New in This version

This version of the tutorial has been significantly reworked to be as complete and up to date as possible. New topics in this version include:

  • New Java 5.0 language features, including typesafe enumerations, variable-length argument lists (varargs), the enhanced for loop, autoboxing, static imports, and annotations (s 4 through 7)
  • A full chapter on generics and parameterized types ()
  • Full coverage of the new Java concurrency package, including details on executors, thread pools, read/write locks, and more ()
  • Printf-style text formatting and the new Scanner text-parsing API ()
  • New Collections classes, including Queue and Concurrent collections ()
  • Enhanced RMI ()
  • Using and writing web services with the Java Web Services Developer Pack (s 14 and 15)
  • Coverage of NetBeans 4.x ()
  • Major XML enhancements, including XML schema and validation, JAXB XML binding, XPath Expressions, and XInclude document processing ()
  • Introduction to the Eclipse IDE 3.x (Appendix A) and Audience

This tutorial is for computer professionals, students, technical people, and Finnish hackers. It's for everyone who has a need for hands-on experience with the Java language with an eye toward building real apps. This tutorial could also be considered a crash course in object-oriented programming, networking, GUIs, and XML. As you learn about Java, you'll also learn a powerful and practical approach to software development beginning with a deep understanding of the fundamentals of Java and its APIs. Superficially, Java looks like C or C++, so you'll have a tiny head start in using this tutorial if you have some experience with one of these languages. If you do not, don't worry. Don't make too much of the syntactic similarities between Java and C or C++. In many respects, Java acts like more dynamic languages such as Smalltalk and Lisp. Knowledge of another object-oriented coding language should certainly help, although you may have to change some ideas and unlearn a few habits. Java is considerably simpler than languages such as C++ and Smalltalk. If you learn well from good, concise examples and personal experimentation, we think you'll like this tutorial. The last part of this tutorial branches out to discuss Java in the context of web apps, web services, and XML processing, so you should be familiar with the basic ideas behind web browsers, servers, and documents.

Java ScreenShot