| ||||||||||||||||||||
|
| ||||||||||||||||||||
Java ResourcesPublished: Mar 08, 2006 OverviewI don't think there is much I can add to what people already know about Java, but I'll try, anyway. First off, there is more than one thing that goes by that name. At the very least, the term Java may apply to (a) the language, (b) the platform, and (c) the API. Here I'll briefly describe each of these things so we get a point of reference as to what we are talking about. LanguageThe Java language was invented in the early 90s by the guy named James Gosling who led the development of an experimental platform that was viewed by Sun as their secret weapon in the network computing battles to come. At the time, most system-level software was written in C/C++, which was sort of OK, except that having to maintain an assortment of flavors, one for each of the major hardware/OS platforms, was an incredible pain in the neck, which added considerably to the cost of development. Not surprisingly, platform independence was the working group's imperative from day one: it drove the entire design of the new language and largely determined the way it evolved into the Java we know today. There were other items on their wish list: object orientation, automatic memory management, built-in networking capability, C-like syntax, etc.; those were important, but still secondary goals. The primary one was platform independence. So how does one approach that? It turns out, the mankind has known the answer for ages: emulation. What you do is devise a fictional machine. Define its CPU and I/O architecture, a memory addressing model and an instruction set, create an implementation per that spec, and you get yourself a fine virtual machine. Which is exactly what Gosling & Co. did. Of course, this is easier said than done, and the team of Java creators indeed deserves a lot of credit, but again: the idea was not new. It just took a real business need, a prosperous company with a strategic vision, a bunch of inspired enthusiasts, a few years of hard work, dedication, contemplation, experimentation, trial and error, communication, and yet more hard work — and voila: a new language was born! After Java's first release was officially announced in 1995, Sun made a conscious decision to make further development of Java an open and community-driven process, and this is the part that alone makes Java an infinitely better platform than any closed, proprietary technology such as that of Microsoft. It is due to the coordinated effort of many people and organizations known as the Java Community Process (JCP) that Java has become such a mature technology with a lot of momentum and a growing army of enthusiasts and open-source developers who keep expanding the frontiers of the Java universe. PlatformJava as a platform consists of the Java Virtual Machine (JVM) specification and its numerous implementations for a host of hardware/OS platforms ranging from handheld devices to mainframes. A JVM executes Java bytecode, which is what your Java program ends up as when processed by a Java compiler. Because of this intermediate format, some people tend to think of Java as an interpreted language. Make no mistake about it: Java is a compiled language, and as such exhibits the strengths naturally present in compiled languages: high performance and type safety. It did take some time for Sun's engineers to find ways to make Java runtime environments more agile, but now, thanks to the latest advancements in just-in-time (JIT) compilation and garbage collection algorithms, Java programs are well on par with their native code counterparts in terms of performance.
APIOne of the best things you get for free in the Java world is the abundant collection of standard APIs that cover almost all of your everyday programming needs, from basic I/O to string manipulation to GUI programming to encryption to network communication and what not. The sheer number of packages, classes and interfaces can be overwhelming, but don't let the verbosity of the APIs make you freak out. You don't have to swallow the whole beast in one gulp — take a bit at a time. Once you've familiarized yourself with some of the more frequently used packages, such as java.io, java.util and java.text, writing Java code will be pretty comfortable, with only an occasional lookup in the API reference every now and then. And if you are still hesitating, think about this: what if the APIs were not there? What if you had to write your own library for every single task you work on? I don't think creating a collection of socket primitives from scratch would sound like an exciting idea if all you wanted to do was grab the content of a remote web page. Standards and SpecificationsThe official Java Language Specification page. The Java Virtual Machine Specification Java 2 Platform Standard Edition API Specification (version 5.0) (http://java.sun.com/j2se/1.5.0/docs/api/) You will want to bookmark (and/or download) all three of these. The one you will use most frequently is the API reference (obviously). The language spec is best used as a complement to the general Java tutorial(s) you choose, and will prove especially helpful when you need to quickly brush up on some of the finer points, such as the inner classes visibility rules or sign propagation in bitwise shift operators. Speaking of the JVM specification, you probably should be fine without even touching it in your early stages of learning Java. You will cross that bridge when you actually come to it: like when you feel the need to better understand Java security or the class loader architecture — which is very unlikely to happen anytime soon. BooksBruce Eckel I cannott recommend this book highly enough — it is a classic and a must have. BUT! Don't make it your first book on Java. Unfortunately, the volume of material discussed in the book has grown over the years to an unthinkable 1,500 pages, so you might want to choose one of the earlier editions instead. Better yet, take on this one after you've picked up the basics from a less ambitious introductory book. Herbert Schildt A somewhat leaner book that also does a good job at explaining the basics of Java (not as good in the OO department though). Kathy Sierra & Bert Bates Head First Java is a book that takes a lighter approach to teaching hard stuff. Using a narrative style with lots of humor sprinkled here and there, the authors walk you through a series of easy-to-grasp examples and eventually manage to get quite a bit of ground covered. This book is not deep enough, but it can give you a very good kickstart if you are new to programming. Joshua Bloch Effective Java Programming Language Guide Effective Java is not a beginner's book: it won't be of much help in your early struggles with the language, but if you check it out at some point down the road, you will find it absolutely invaluable, as the 50+ gems of hard-earned wisdom the book is broken down into is exactly what a novice to intermediate Java programmer needs to know to make a quantum leap and reach the next level of excellence. Online ResourcesTutorialsSun's tutorials on Java are kind of sloppy and definitely lack coherence, but it probably won't hurt to give them a try since they are free and publicly available: http://java.sun.com/docs/books/tutorial/ Online BooksBruce Eckel, Thinking In Java (based on the third edition of 2002). Bill Venners, Inside The Java Virtual Machine The book is accompanied by a number of interactive applets that provide a graphic illustration of what happens inside the JVM as it executes the bytecode: |
||||||||||||||||||||
| ||||||||||||||||||||