Skip to main content

An Introduction to Java Concepts

Posted by potty on January 30, 2014 at 1:35 PM PST

What is Java?

Java is an high-level programming language created by James Gosling from Sun Microsystems on 1991, released on 1995. Nowadays, Oracle Corporation has the steermanship for Java. Its license is GNU General Public License (GPL).

Is executed on more than 850 millions of devices on all over the world. Java applications are compiled to bytecode that can run on any Java Virtual Machine (JVM), regardless of the computer architecture. According to TIOBE Software, Java is the second most used programming language.

As stated by Sun Microsystems, there were five primary principles in the creation of Java:

  1. Simple, object-oriented and familiar.
  2. Robust and secure.
  3. Architecture-neutral and portable.
  4. High performance.
  5. Interpreted, threaded and dynamic.

Versions

These are the major releases of Java with their respective dates:

JDK 1.0 01/21/1996
JDK 1.1 02/19/1997
J2SE 1.2 12/08/1998
J2SE 1.3 05/08/2000
J2SE 1.4 02/06/2002
J2SE 5.0 09/30/2004
Java SE 6 12/11/2006
Java SE 7 07/28/2011
Java SE 8 03/18/2014

Since the release of JDK 5.0, Oracle changed the version numbering scheme for minor releases:

  • Limited Update Releases: Numbered in multiples of 20. These represent the release of new functionalities.
  • Critical Patch Updates: Continue to use odd numbers. It include fixes for security vulnerabilities.

Distributions

Java, as many programming languages, has suffered changes along its history. Today, Java have three main distributions with their particular features:

J2SE

Java 2 Standard Edition. Oriented to the development of client-server applications. Does not include the technologies for web applications. It is the base for the other two distributions and is the most used platform.

J2EE

Java 2 Enterprise Edition. Oriented to the enterprises and the consolidation of their information systems. Do include the technologies for web applications (server and client side). Its base is J2SE.

J2ME

Java 2 Micro Edition. Oriented to small mobile devices (phones, tablets). Does not include the technologies for web applications. Its base is J2SE but it have extra features.

The following diagram shows the relation between each distribution:

JDK, JRE, JVM

These are the most confusing terms for Java new programmers. The following diagram explains:

JDK

Java Development Kit: Contains all the tools needed to compile Java source files and the JRE to execute them. You will need it if you want to write your own programs, compile and execute them. There are multiple versions, e.g. Eclipse Java Compiler, GNU Compiler for Java, OpenJDK, Oracle Java SDK.

JRE

Java Runtime Environment: Contains the JVM, class libraries and supporting files. It does not contain any development tools. You will need it if you want to execute any Java program.

JVM

Java Virtual Machine: Provides a platform-independent way of executing code. It is important to mention that the JVM itself is platform-dependent. It interprets the bytecode generated by the Java Compiler depending upon the underlying operating system and hardware combinations. There are many JVM, e.g. JRockit, JInitiator, IcedTea.

Development Process with Java

The source files are plain text documents. The programmer can take advantage of an Integrated Development Environment (IDE) for programming, e.g. Eclipse or Netbeans. At some point the programmer calls the Java compiler (javac). It creates the bytecode instructions. The compiled version is stored as a class file and can be executed by the Java Virtual Machine (using or not classpaths).

Syntax

The Java syntax is similar to C++ but it combines the syntax for multiple programming paradigms although it was built almost as an object-oriented programming language. In Java, everything is contained within class and everything is an object, except for primitive data types (performance is the main reason). Java is case sensitive but it does have naming conventions.

Test: Hello World

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello, World");
    }

}

References

  1. TOBIE Software. TOBIE Index for January 2014. Link.
  2. Oracle Corporation. Java Platform Standard Edition 7 Documentation. Link.
  3. Oracle Corporation. Java SE - Change in Numbering Scheme. Link.
AttachmentSize
java_logo.png16.08 KB
java_distributions.png9.49 KB
java_dev.png2.82 KB
java_stack.png6.58 KB