Java

From Canonica AI

Overview

Java is a high-level programming language and computing platform first released by Sun Microsystems in 1995. It is class-based, object-oriented, and designed to have as few implementation dependencies as possible. Java applications are typically compiled to bytecode that can run on any Java Virtual Machine (JVM) regardless of the underlying computer architecture.

History

Java was conceived by James Gosling, Patrick Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991. It took 18 months to develop the first working version. The language was initially called Oak, after an oak tree that stood outside Gosling's office, then it was renamed to Green, and later to Java, from Java coffee, a type of coffee from Indonesia.

Syntax

Java's syntax is similar to C++, but with fewer low-level facilities. Java uses comments similar to those of C++. There are three kinds of comments: single-line, multi-line, and Javadoc. Single-line comments start with two slashes and continue to the end of the line. Multi-line comments start with a slash and an asterisk, and can go on for several lines. Javadoc comments are multi-line comments that precede class, field, or method declarations.

Java Class Structure

A Java program is made up of classes. A class in Java contains methods. Methods in Java contain the executable code. Java is an object-oriented programming language, which means that it represents concepts as "objects" with "fields" (which are attributes that describe the object) and "methods" (procedures the object can perform).

Java Virtual Machine

The Java Virtual Machine (JVM) is an abstract computing machine. The JVM is a software implementation of a computer that executes programs like a real machine. The Java Virtual Machine is written in the Java language and it is included in the Java Runtime Environment (JRE).

Java Development Kit

The Java Development Kit (JDK) is a software development environment used for developing Java applications and applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation generator (Javadoc), and other tools needed in Java development.

Java Libraries

Java's standard library provides a large number of useful utility classes, from data structures to GUI programming classes. These libraries are included in the Java Runtime Environment.

Java and the Web

Java is widely used in web servers, providing support for web services, networking, I/O, database connection, and more. Many of Google's web servers are written in Java.

See Also

A photograph of a computer screen displaying code written in the Java programming language.
A photograph of a computer screen displaying code written in the Java programming language.