Search This Blog

UI/UX Design | Web Development | Mobile Application Development

Whether you need UI/ UX design, web development services, or mobile app development services, Qaabil Digitals will be more than happy to help you. We work with top software developers, designers, and project managers. We tailor our services to suit your exact needs. We closely look at your company, listen to your story, and bring about the best ideas and solutions that can help you drive solid results. We don’t just produce work that works. We produce work that matters. Get a quote now Or Talk to us

Sunday 5 June 2011

How to write a simple java program

Java is very powerful and secure language with multiple features. Writing a java program is a very simple method. Here is the syntax of a simple java program

class  name
{
public static void main (String arg[])
{

// body.

}
}

here “name” is the name of class and you will save your program with this name. You can write anny name of your class but not reserve words of java. The function “public static void main (String arg[])” is java’s main function.

Remember you must save your program like this:

"class-name.java"

otherwise it will not execute/compile.

Note: 
         java is case sensitive language and you have to write the main function as it is written above.
“body” means the code of your java program.
Share