Simple Java Program for Beginners

on 11:20 PM

Hello World Java

Simple Java Program for beginners (The HelloWorld.java)

Java is powerful programming language and it is used to develop robust applications. Writing a simple Hello World program is stepwise step. This short example shows how to write first java application and compile and run it. I am assuming that latest version of JDK is installed on your machine

HelloWorld.java - the source code for the "Hello, world!" program

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

How to save
To run this program, save it in a file with the name HelloWorld.java. It must be sure that the file name must match the name of the class.

Compile the program

javac HelloWorld.java command is used to compile the source code.
When you compile the program you'll create a byte-code file named HelloWorld.class.
You can confirm this with the dir command in the DOS/Windows world.

Execute the byte code
Now you can execute the byte code in the Java interpreter with this command:
java HelloWorld

Output of the program
When you run the program at the command line, you'll see this output
Hello, world!

Understanding the HelloWorld.java code
Let's examine the HelloWorld.java file. Class is the basic building block of the java program, java codes are written in the java class.

class HelloWorld{

//Java Codes

}

Java codes are saved in the same name as the class name.java, so we have saved the file with the name "HelloWorld.java".

There is one method public static void main (String[] args) which is necessary to for any class to be runnable. This function is the entry point of the execution. And the code System.out.println("Hello World!"); actually writes the Hello World! on the screen

.Net Tutorial - How to Install .NET on new Windows 7

on 11:00 PM

How to download and install Java JDK

on 10:55 PM

A Must watch for JAVA Beginner


.NET

on 12:04 PM

.NET

Microsoft's .NET CLI executable environment, and some of the corresponding class library, have been standardized and can be freely implemented without a license. A few standards-compliant free software environments have been implemented, such as the Mono Project and DotGNU. The Mono Project has also implemented many of Microsoft's non-standard libraries by examining Microsoft materials, similar to GNU Classpath and Java.

Microsoft is currently distributing a shared source version of its .NET runtime environment for academic use, however it is only supported on Windows 7 and has not been updated after .NET 4.0.[7]

The Mono project aims to avoid infringing on any patents or copyrights, and to the extent that they are successful, the project can be safely distributed and used under the GPL. On November 2, 2006, Microsoft and Novell announced a joint agreement whereby Microsoft promised not to sue Novell or its customers for patent infringement.[8] According to a statement on the blog of Mono project leader Miguel de Icaza, this agreement only extends to Mono for Novell developers and users.[9] Because of the possible threat of Microsoft patents, the FSF recommends that people avoid creating software that depends on Mono or C#.[10][11]

The Microsoft/Novell agreement was criticized by some in the open source community because it violates the principles of giving equal rights to all users of a particular program (see Agreement with Microsoft and Mono and Microsoft's patents).

JAVA

on 12:03 PM

Java

The primary implementation of the Java platform is available as an Open Source implementation called OpenJDK.

While "Java" is an Oracle trademark, and only Oracle can license the name "Java", numerous free software projects exist that are compatible with Oracle Java. Most notably, GNU Classpath and GCJ provide a free software class library and a compiler that are partially compatible with the current version of OracleJava.[1] Sun announced on November 13, 2006 that all Java source code, excluding closed-source code for which they do not retain rights, will be released under a modified version of the GPL,[2] and released two fundamental parts of the JRE and JDK: HotSpot and the javac compiler under the GPL.[3][4]

Following their promise, Sun released the complete source code of the Class library under GPL on May 8, 2007, except some limited parts that were licensed by Sun from 3rd parties who did not want their code to be released under an open-source license[5] (see also Free Java implementations). Sun's goal is to replace the parts that remain closed with alternative implementations and make the class library completely open.

In June 2008, Red Hat announced[6] that the IcedTea project has passed the rigorous Java TCK, indicating a fully functional open-source implementation of the Java platform.