To learn Java, it is important to know the difference among the Java programming language, the JVM, and the Java platform.
The Java programming language is the language in which Java applications, applets, components ,jsp and servlets are written.
A Java Virtual Machine (JVM), is a virtual machine that interprets and executes Java bytecode.The JVM can be implemented directly in hardware, but it is usually implemented in the form of a software program that interprets and executes byte codes.
All programs written in the Java language rely on the set of predefined classes that comprise the Java platform. Java classes are organized into related groups known as packages. The Java platform defines packages for functionality such as input/output, networking, graphics, user-interface creation, security, and much more.
History of Java
There have been seven major versions of Java since Sun formally announced Java and HotJava at SunWorld `95.
Java 1.0
This was the first public version of Java. It contained 212 classes organized in 8 packages. It is now completely outdated.
Java 1.1
This release of Java has 504 classes in 23 packages. It introduced inner classes. This version is outdated.
Java 1.2
This release of Java has 1,520 classes in 59 packages..
Java 1.3
This was primarily a maintenance release, focused on bug fixes, stability, and performance improvements
Java 1.4
This release had some new features,such as a high-performance, low-level I/O API; supporting for pattern matching with regular expressions; a logging API;new Collections classes; a user preferences API; an XML-based persistence mechanism for JavaBeans; support for XML parsing using both the DOM and SAX APIs; user authentication with the JAAS API; support for secure network connections using the SSL protocol.
Java 5.0
This release of Java introduced a number of changes to the core language itself including generic types, enumerated types, annotations, varargs methods, autoboxing, and a new for/in statement.
Java 6.0
Java SE 6 is the current major release of the Java SE platform. Sun endeavors to foster the highest level of transparency and collaboration on the platform with the Java community through Project JDK 6, resulting in the following key features.New Security Features and Enhancements;Integrated Web Services;Scripting Language Support (JSR 223) ;Enhanced Management and Serviceability ;JDBC 4.0 support (JSR 221) ;Enhanced internationalization support
A Java Example Program Hello World
// package declaration package org.javadevelopment; // Class name public class Hello { // All programs must have main( ) public static void main(String[ ] args) { // output "Hello World!" System.out.println("Hello World!"); // This marks the end of main( ) } // Marks the end of the class }
Running Hello World
The first step in running this program is to type above code using a text editor and save the program in a file named Hello.java.
The second step is to compile the program. If you are using the Java Software Development Kit (SDK) from Sun, you compile code with the javac command. javac Hello.java