Thursday, November 22, 2012

0 Java Basic Syntax


package javaapplication6;


public class Main
{
    public static void main(String[] args)
    {
    System.out.print("MY FIRST JAVA PROGRAM");
    }
}


This program shows  how to print a simple text in java .
in the above example the "javaapplication6" is the program Package(Packages are used in Java in-order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier etc)..

"Main" is the Class(A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support).

"main() Method" It is compulsory in  java program, when you execute a class in java the run time will start it's execution by calling the main Method. the main method  then calls the other methods required to run .

The "System.out.print()" is a java method to print plane text..



0 comments:

Post a Comment

 

Code Sea Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates