Java is a high-level, platform-independent, object-oriented programming language and run-time environment. The Java language derives much of its syntax from c and c++, but its object model is simpler than that of c++ and it has fewer low-level facilities. Java applications are typically compiled to bytecode (called class files) that can be executed by a Java Virtual Machine jvm, independent of computer architecture. The jvm manages memory with the help of a garbage collector (see garbage-collection) in order to handle object removal from memory when not used anymore, as opposed to manually deallocating memory like other languages such as c++.
java is designed to have as few implementation dependencies as possible, intended to allow application developers to "write once, run anywhere" (WORA): code that executes on one platform need not be recompiled to run on another. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform.
The Java language was created with the following primary goals:
Simple, object-oriented and familiar.
Robust and secure.
Architecture-neutral and portable.
Execute with high performance.
Interpreted, multi-threaded, and dynamic.
Write once, run anywhere (WORA).
Java is a high-level, platform-independent, object-oriented programming language originally developed by James Gosling for Sun Microsystems and released in 1995. The Java trademark is currently owned by Oracle, which purchased Sun Microsystems on April 20, 2009.
The main reference implementation of Java is open source (the OpenJDK), and is supported by major companies including Oracle, Apple, SAP and IBM.
Very few computers can run Java programs directly. Therefore, the Java environment is normally made available by installing a suitable software component. For Windows computers, this is usually done by downloading the free Java Runtime Environment (JRE) from java.com. On Macintosh computers, the user is prompted to download Java when an application requiring it is started. On linux-like systems, Java is typically installed via the package manager.
Developers frequently need additional tools which are available in the free Java Development Kit (JDK) alternative to the JRE, which for Windows must be downloaded from Oracle and installed manually.
Java is compiled into bytecode which is interpreted on the JVM by compiling into native code. The compilation is done just-in-time (JIT). Initially this was viewed as a performance hit, but JVM and JIT compilation improvements have made this less of a concern. In some cases, the JVM may even be faster than native code compiled to target an older version of a processor for backward-compatibility reasons.
Note : Other vendors exist, though almost all have license fees. For linux and other platforms, consult the operating system documentation.
Notable Java versions, code names, and release dates include:
Before asking a question, use the search box in the upper-right corner to see if it has been asked before (we have many duplicates), and please read Writing the perfect question to learn how to get Jon Skeet to answer your question.
Java programs should adhere to the following naming conventions to increase readability and decrease chances of accidental errors. By following these naming conventions, you will make it easier for others to understand your code and help you.
Type names (classes, interfaces, enums, etc.) should begin with a capital letter, and capitalize the first letter of each subsequent word. Examples include: String, ThreadLocal, and NullPointerException. This is sometimes known as Pascal Case.
Method names should be camelCased; that is, they should begin with a lowercase letter and capitalize the first letter of each subsequent word. Examples: indexOf, printStackTrace, interrupt.
Field names should be camelCased just like method names.
Constant expression names (static final immutable objects) should be written in ALL_CAPS, with underscores separating each word. Examples: YELLOW, DO_NOTHING_ON_CLOSE. This also applies to values of an Enum class. However, static final references to non-immutable objects should be camelCased.