- Java is a programming language
- Object oriented
- Extremely portable
- Very small compiled files
- Designed for the web
- Built in: security, networking, multiprocessing
- Ancestors: C / C++
- Would-be look-alike: C#
- Do not confuse with Javascript (no relation)
- Java was first released by Sun Microsystems in 1995. It had 100,000 developers using it within 6 months
Java is object oriented
- An object is a set of data together with a set of methods (routines) for accessing and processing the data. It encapsulates everything relevant to the object, thereby minimising inadvertent side-effects. The data define the state of the object. The methods define its behaviour.
- A class is the definition of the data and methods - a recipe for making objects. Objects are instances of classes.
In Java everything is defined in some class - even the main program. There are no global data, thus avoiding name clashes.
Java is portable
- The instruction set (called byte code) is independent of any real machine. It is executed by a Java Virtual Machine (JVM) that runs on the host system.
- Java is compiled to byte code, designed for fast interpreting at execution time. JVM interpreters are very fast, using caching and look-ahead (JIT - Just In Time) techniques.
- There is a JVM for most platforms, so Java is extremely portable (data types make it even more so - see later).
- The JVM forms part of the Java Run-time Environment (JRE), available free from Sun Microsystems (now taken over by Oracle but the URL is still java.sun.com).
- You must have the JRE in order to run a Java application.