Java Overview - ilya-khadykin/notes-outdated GitHub Wiki
Java
is a powerful, general-purpose programming language. It is one of the most widely used programming languages in the world, and has been exceptionnaly successfull in business and enterprise computing. (1)
The Java programming environment has been around since the late 1990s. Java's architecture (separation between the runtime and the language) was novel at the time. That allowed different vendors working on development of Java competing and collaborating with each other which was the main reason of success of Java.
The language has undergone gradual revision (but not complete rewrites) since its inception in 1996.
The language, The JVM, and The Ecosystem (1)
The Java programming environment comprises the following pieces:
- the Java language,
- the supportive runtime (known as the Java Virtual Machine `JVM)
Java ecosystem is a standardized environment , there are specification for the technologies that comprise the environment.
The current steward of Java is Oracle Corporation (who acquired Sun Microsystems, the originator of Java).
There is also an open source version of Java, called OpenJDK
, which many companies collaborate on.
Java comprises several different, but related environment and specifications:
Java Mobile Edition (Java ME)
Java Standard Edition (Java SE)
Java Enterprise Edition (Java EE)
the Java language is a human-readable programming language, which is class based and object oriented.
Java 8 has added the most radical changes seen in the language for almost a decade (or since the birth of Java)
The Java language is governed by the Java Language Specification (JLS)
, which defines how a conforming implementation must behave.
The JVM is a program that provides the runtime environment necessary for Java programs to execute.
The JVM has been ported to run on a large number of environments (OS platforms and hardware)
Java programs are typically started by a command line, such as:
java <arguments> <program name>
JVM executes **Java bytecode``** in a format called class files which must be
compiled` from a source code.
JVM collects runtime information to make better decisions about how to execute code (just-in-time (JIT) compilation, 'hot methods' (the most used methods) compiled into machine code).
The standard that describes how a properly functioning JVM must behave is called JVM Specification
Because the Java VM is available on many different operating systems, the same .class
files are capable of running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS. Some virtual machines, such as the Java SE HotSpot at a Glance, perform additional steps at runtime to give your application a performance boost. This includes various tasks such as finding performance bottlenecks and recompiling (to native code) frequently used sections of code.
The Java platform has two components:
- The Java Virtual Machine (JVM)
- The Java Application Programming Interface (API)
The API is a large collection of ready-made software components that provide many useful capabilities. It is grouped into libraries of related classes and interfaces; these libraries are known as packages.
The API and Java Virtual Machine insulate the program from the underlying hardware:
As a platform-independent environment, the Java platform can be a bit slower than native code. However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.
The general-purpose, high-level Java programming language is a powerful software platform. Every full implementation of the Java platform gives you the following features:
-
Development Tools: The development tools provide everything you'll need for compiling, running, monitoring, debugging, and documenting your applications. As a new developer, the main tools you'll be using are the
javac
compiler, thejava
launcher, and thejavadoc
documentation tool. - Application Programming Interface (API): The API provides the core functionality of the Java programming language. It offers a wide array of useful classes ready for use in your own applications. It spans everything from basic objects, to networking and security, to XML generation and database access, and more. The core API is very large; to get an overview of what it contains, consult the Java Platform Standard Edition 8 Documentation.
- Deployment Technologies: The JDK software provides standard mechanisms such as the Java Web Start software and Java Plug-In software for deploying your applications to end users.
- User Interface Toolkits: The JavaFX, Swing, and Java 2D toolkits make it possible to create sophisticated Graphical User Interfaces (GUIs).
- Integration Libraries: Integration libraries such as the Java IDL API, JDBC API, Java Naming and Directory Interface (JNDI) API, Java RMI, and Java Remote Method Invocation over Internet Inter-ORB Protocol Technology (Java RMI-IIOP Technology) enable database access and manipulation of remote objects.
This is how Java code is compiled and loaded:
The Official Documention can be found here - docs.oracle.com/javase/
package package1;
// import the namespace
import java.util.Date;
namespace is similar to a family name
Full name of a class is <package>.<class_name>
(fully qualified name).