Category:Java



Java is a one of the most common programming languages today. Java is a concurrent, class-based, object-oriented and specifically designed to have few implemation dependencies as possible. Java is intented to let application developers "write once, run anywhere" meaning the code does not have to recompile to run on another. Java is much like C++ and C but has fewer low level facilities than both of them.

History
 James Gosling, Mike Sheridan, and  Patrick Naughton  initiated the Java language project in June 1991. Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. The language was initially called  Oak  after an oak tree that stood outside Gosling's office; it went by the name Green later, and was later renamed Java, from Java coffee, said to be consumed in large quantities by the language's creators.Gosling aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.

 Sun Microsystems  released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost run-times on popularplatforms. Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Major web browsers soon incorporated the ability to run  Java applets  within web pages, and Java quickly became popular. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 – 1999), new versions had multiple configurations built for different types of platforms. For example, J2EE targeted enterprise applications and the greatly stripped-down version J2ME for mobile applications (Mobile Java). J2SE designated the Standard Edition. In 2006, for marketing purposes, Sun renamed new J2 versions as  Java EE ,  Java ME , and  Java SE , respectively.

 In 1997, Sun Microsystems approached the  ISO/IEC JTC1  standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.[16 ]Java remains a  de facto  standard, controlled through the  Java Community Process .[17] At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) (a subset of the SDK); the primary distinction involves the JRE's lack of the compiler, utility programs, and header files.

 On November 13, 2006, Sun released much of Java as free and open source software, (FOSS), under the terms of the GNU General Public License (GPL). On May 8, 2007, Sun finished the process, making all of Java's core code available under free software/open-source distribution terms, aside from a small portion of code to which Sun did not hold the copyright.

 Sun's vice-president Rich Green said that Sun's ideal role with regards to Java was as an "evangelist."[19 ] Following Oracle Corporation's acquisition of Sun Microsystems in 2009–2010, Oracle has described itself as the "steward of Java technology with a relentless commitment to fostering a community of participation and transparency".[20]This did not hold Oracle, however, from filing a lawsuit against Google shortly after that for using Java inside the Android SDK (see Google section below). Java software runs on everything from laptops todata centers, game consoles to scientific supercomputers. There are 930 million Java Runtime Environment downloads each year and 3 billion mobile phones run Java. On April 2, 2010, James Gosling resigned from Oracle.



 

Examples
 Java program may contain multiple classes that have main methods, which means that the VM needs to be explicitly told which class to launch from.

 The main method must accept an array of  String  objects. By convention, it is referenced as  args  although any other legal identifier name can be used. Since Java 5, the main method can also use variable arguments, in the form of public static void main(String... args), allowing the main method to be invoked with an arbitrary number of String arguments. The effect of this alternate declaration is semantically identical (the args parameter is still an array of String objects), but it allows an alternative syntax for creating and passing the array.

 The Java launcher launches Java by loading a given class (specified on the command line or as an attribute in a JAR) and starting its public static void main(String[]) method. Stand-alone programs must declare this method explicitly. The String[] args parameter is an array of String objects containing any arguments passed to the class. The parameters to main are often passed by means of a command line.

 Printing is part of a Java standard library: The  System  class defines a public static field called  out . The out object is an instance of the PrintStream class and provides many methods for printing data to standard out, including  println(String)  which also appends a new line to the passed string.

 The string "Hello, world!" is automatically converted to a String object by the compiler.