Java (programming language)

From Conservapedia
This is an old revision of this page, as edited by GuidoF (Talk | contribs) at 15:33, 14 July 2011. It may differ significantly from current revision.

Jump to: navigation, search
Java logo.

Java is an object-oriented programming language developed by Sun Microsystems in the 1990's. Its syntax is similar to that of C++, but with some modifications. One of the major features which make Java programs easier to write than C++ programs is its support for automatic memory management.

The Java compiler provided by Sun Microsystems compiles Java code to bytecode, which requires the Java Virtual Machine (commonly referred to as a JVM) to execute. This model was adopted by Microsoft for C# and other .NET languages. IBM and others supply regular Java compilers for those who don't want to use the virtual machine.

Java applications are popular in creating applets for websites, due to their cross-platform nature. It still has not gained widespread popularity in stand-alone Windows applications, but is used primarily on web servers.

Memory Management

The Java programming language is based on Object Oriented programming principles, coupled with garbage collection. This means, unlike C and other lower level programming languages the developer is able to create programs without worrying about pointers, references and memory. Instead the Java Virtual Machine is able to manage objects that are in use, periodically deleting objects that are no longer referenced (and therefore no longer required by the program).

Example Code

Hello, World

The easiest program in any language is something that displays "Hello, World!".

package hello;

public class World
    public static void main(String[] args) 
        System.out.println("Hello, World!"); 

GUI with JFrame

An example of creating and showing a JFrame with nothing in it:

JFrame frame = new JFrame();;

External Links

Official Java Website