Saturday, March 1, 2014

About 
Java is a high-levelplatform-independentobject-oriented programming language and run-time environment. The Java language derives much of its syntax from  and , but its object model is simpler than that of  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 , independent of computer architecture. The  manages memory with the help of a garbage collector (see ) in order to handle object removal from memory when not used anymore, as opposed to manually deallocating memory like other languages such as .
 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.

Principles

The Java language was created with the following primary goals:
  1. Simple, object-oriented and familiar.
  2. Robust and secure.
  3. Architecture-neutral and portable.
  4. Execute with high performance.
  5. Interpreted, multi-threaded, and dynamic.
  6. Write once, run anywhere (WORA).
  7. Inheritance.
  8. Encapsulation.
  9. Polymorphic.

Background

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 -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  and other platforms, consult the operating system documentation.

Versions

Notable Java versions, code names, and release dates include:
JDK 1.0                  (January 23, 1996)
JDK 1.1                  (February 19, 1997)
J2SE 1.2    [Playground] (December 8, 1998)
J2SE 1.3    [Kestrel]    (May 8, 2000)
J2SE 1.4    [Merlin]     (February 6, 2002)
J2SE 5.0    [Tiger]      (September 30, 2004)
Java SE 6   [Mustang]    (December 11, 2006)
Java SE 7   [Dolphin]    (July 28, 2011)
Java SE 8   [JSR 337]    (March 18, 2014) *Scheduled for General Availability*
For more code names and release dates, visit J2SE Code Names. To see release notes for each version of the JDK, visit the Wikipedia article on Java version history.
Java SE 8 is expected in the first quarter of 2014 and is available as an Early Access Download.
The End Of Public Updates (Formerly called End Of Life) dates are:
J2SE 1.4   -  Oct 2008
J2SE 5.0   -  Oct 2009
Java SE 6  -  Feb 2013
Java SE 7  -  Mar 2015

Initial help

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.

Naming conventions

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: StringThreadLocal, 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: indexOfprintStackTraceinterrupt.
  • 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: YELLOWDO_NOTHING_ON_CLOSE. This also applies to values of an Enum class. However, static final references to non-immutable objects should be camelCased.

Hello World

public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
Compilation and invocation of Hello World:
javac -d . HelloWorld.java
java -cp . HelloWorld
Java source code is compiled to an intermediate form (bytecode instructions for the Java Virtual Machine) that can be executed with the java command.
More information:

Beginners' resources

Day-to-day resources

Advanced resources

Free Java programming books and resources

Frequently Asked Questions

People often ask about the following Java topics:
(Submitters, please only list questions which actually are frequently asked.)

Chat rooms

history | show excerpt | excerpt history

8 comments:

oakleyses said...

louis vuitton handbags, oakley sunglasses, louboutin, longchamp outlet, nike shoes, louis vuitton outlet stores, chanel handbags, burberry outlet, prada outlet, jordan shoes, tiffany and co, michael kors outlet, tory burch outlet, louis vuitton outlet, longchamp handbags, nike free, true religion jeans, michael kors outlet, kate spade outlet, polo ralph lauren outlet, tiffany and co, prada handbags, polo ralph lauren outlet, michael kors outlet, michael kors outlet, longchamp handbags, oakley sunglasses, ray ban sunglasses, kate spade handbags, burberry outlet, louis vuitton outlet, louboutin outlet, louboutin, coach factory outlet, air max, air max, coach outlet, gucci outlet, christian louboutin shoes, michael kors outlet, coach purses, ray ban sunglasses, michael kors outlet, louis vuitton, coach outlet store online, true religion jeans, oakley sunglasses cheap

oakleyses said...

ralph lauren, lululemon, air max, hollister, north face, nike air max, polo lacoste, vanessa bruno, timberland, vans pas cher, louboutin, louis vuitton, oakley pas cher, air max pas cher, nike roshe run, air max, true religion outlet, barbour, sac longchamp, air force, hollister, sac louis vuitton, nike free, polo ralph lauren, nike trainers, louis vuitton uk, nike roshe, sac hermes, longchamp, michael kors, sac burberry, sac guess, mulberry, new balance pas cher, converse pas cher, sac louis vuitton, hogan outlet, nike tn, north face, true religion outlet, ray ban pas cher, michael kors, air jordan, nike blazer, nike free pas cher, michael kors pas cher, abercrombie and fitch, ray ban sunglasses

oakleyses said...

mac cosmetics, mont blanc, marc jacobs, canada goose outlet, nike huarache, vans shoes, soccer jerseys, hollister, giuseppe zanotti, beats by dre, abercrombie and fitch, longchamp, insanity workout, celine handbags, bottega veneta, ghd, nfl jerseys, north face outlet, chi flat iron, ugg boots, birkin bag, ugg australia, canada goose, herve leger, ugg pas cher, rolex watches, valentino shoes, canada goose uk, canada goose, ferragamo shoes, canada goose, ugg boots, uggs outlet, north face jackets, soccer shoes, asics running shoes, new balance shoes, p90x, lululemon outlet, canada goose jackets, mcm handbags, instyler, babyliss pro, ugg, wedding dresses, jimmy choo outlet, reebok outlet, nike roshe run

oakleyses said...

parajumpers, karen millen, air max, converse, pandora charms, moncler, louboutin, moncler, links of london, lancel, juicy couture outlet, oakley, hollister, pandora charms, supra shoes, thomas sabo, canada goose, gucci, wedding dresses, timberland boots, swarovski crystal, air max, coach outlet store online, moncler, ray ban, canada goose, moncler, ugg, louis vuitton, swarovski, hollister, montre homme, moncler, hollister clothing store, ralph lauren, rolex watches, moncler outlet, moncler, iphone 6 cases, baseball bats, juicy couture outlet, toms shoes, vans, pandora jewelry, ugg, converse shoes

oakleyses said...

jordan pas cher, chanel handbags, nike outlet, michael kors pas cher, kate spade outlet, replica watches, longchamp pas cher, nike free, jordan shoes, christian louboutin shoes, nike free run, louis vuitton outlet, oakley sunglasses, ray ban sunglasses, polo ralph lauren, ugg boots, christian louboutin uk, air max, louis vuitton outlet, ugg boots, tiffany jewelry, polo ralph lauren outlet online, burberry pas cher, prada outlet, nike air max, gucci handbags, sac longchamp pas cher, ray ban sunglasses, louboutin pas cher, louis vuitton, uggs on sale, tiffany and co, oakley sunglasses, louis vuitton outlet, ray ban sunglasses, longchamp outlet, louis vuitton, longchamp outlet, replica watches, nike roshe, polo outlet, oakley sunglasses, cheap oakley sunglasses, oakley sunglasses wholesale, christian louboutin, christian louboutin outlet, tory burch outlet

oakleyses said...

lululemon canada, nike air max, burberry outlet, oakley pas cher, burberry handbags, coach outlet store online, kate spade, michael kors outlet, michael kors, nike air force, true religion jeans, true religion outlet, michael kors, polo lacoste, nike tn, new balance, abercrombie and fitch uk, michael kors outlet, uggs outlet, michael kors outlet, ralph lauren uk, michael kors outlet online, replica handbags, coach outlet, true religion outlet, coach purses, nike free uk, sac vanessa bruno, mulberry uk, michael kors outlet online, michael kors outlet online, michael kors outlet online, north face, uggs outlet, converse pas cher, hogan outlet, nike air max uk, hollister pas cher, sac hermes, nike roshe run uk, hollister uk, nike air max uk, true religion outlet, timberland pas cher, vans pas cher, ray ban pas cher, guess pas cher, ray ban uk

oakleyses said...

ipad cases, beats by dre, iphone 6 cases, ferragamo shoes, wedding dresses, hollister clothing, p90x workout, instyler, asics running shoes, nike huaraches, hermes belt, north face outlet, s6 case, babyliss, nfl jerseys, hollister, iphone 6 plus cases, insanity workout, ralph lauren, iphone cases, iphone 6s plus cases, bottega veneta, new balance shoes, longchamp uk, iphone 6s cases, giuseppe zanotti outlet, nike roshe run, mont blanc pens, herve leger, oakley, lululemon, timberland boots, nike air max, iphone 5s cases, ghd hair, valentino shoes, louboutin, nike trainers uk, celine handbags, north face outlet, baseball bats, vans outlet, abercrombie and fitch, chi flat iron, soccer jerseys, mac cosmetics, mcm handbags, soccer shoes, jimmy choo outlet, reebok outlet

oakleyses said...

supra shoes, marc jacobs, canada goose, converse outlet, toms shoes, ugg uk, ugg pas cher, canada goose outlet, canada goose, nike air max, louis vuitton, karen millen uk, doudoune moncler, converse, louis vuitton, vans, gucci, montre pas cher, moncler outlet, canada goose uk, canada goose outlet, moncler, pandora jewelry, barbour uk, moncler outlet, juicy couture outlet, louis vuitton, canada goose, pandora uk, coach outlet, swarovski crystal, ugg,uggs,uggs canada, juicy couture outlet, links of london, louis vuitton, louis vuitton, hollister, swarovski, canada goose outlet, ray ban, moncler, ugg, barbour, ugg,ugg australia,ugg italia, replica watches, pandora charms, moncler uk, pandora jewelry, wedding dresses, canada goose jackets, hollister, lancel