Java is an object-oriented language created by Sun. It has several 'versions' - enterprise edition (J2EE), standard edition (J2SE) and mobile edition (J2ME). Java is bytecode-compiled. To create and use a java program, a source code file must first be compiled (the javac binary from sun) and then run through an interpreter (the java binary from sun). The interpreter is often a JustInTimeCompiler. You will often see the interpreter referred to as a "Virtual machine" (or VM), which is just fancy-talk for "interpreter".
Links
Sun's java home page: http://java.sun.com
The API reference: http://java.sun.com/API
The Good
- Object-oriented, static-typed, garbage collected
Javadoc inline code documentation (http://java.sun.com/j2se/javadoc/)
- Extensive libraries
- GUI toolkit libraries
- Java applets
- Cross-platform - interpreters available for all major platforms
- powerful IDEs like Eclipse
The Bad
- Speed - old versions of java were not very fast, although even moderately recent VMs are quite snappy
- Occasionally ugly class library - copying between ICollections and arrays, for instance
- Static typing (yes, this is a good thing and a bad thing. It's personal preference)
- Cross-platform - slight differences in different platforms make testing harder. "Write once, run anywhere" (WORA) became "write once, test everywhere"
- Microsoft's java interpretation is stuck in the stone ages, supporting something like version 1.1 of the java specification. They are almost up to version 1.5 now, and the difference is immeasurable.
Hello World
Whenever Sirrux learns a language, he likes a Hello, World program. Here's his (Put it in a file named Hworld.java <-- Case sensitive)
{{{ public class Hworld {
- public static void main(String[] args) {
- System.out.println("Hello, World");
- } }}}
To run it, run javac on your Hworld.java file then execute "java Hworld" in the same directory. That will attempt to execute the Hworld.class file.
