For a complete list, click JAVA
Refer Introduction to JAVA before going through your first program.
=========================================================================
class firstprogram
{
public static void main(String args[ ])
{
System.out.println("Hai...Welcome...");
}
}
=========================================================================
- Here, firstprogram is the program name.(See, class firstprogram ).The name after declaring the class , is the program name.We have to use the same name , while saving.
- Also note the capital letters of the words String and System. They are case sensitive.
Instead of typing the program in NOTEPAD or DOS prompt , here , we are using some softwares like NETBEANS or ECLIPSE etc..
=========================================================================
(A) : Familier with NETBEANS platform:
Download NetBeans IDE
Download NetBeans from here for free. (You need JDK or Java Development Kit for installing NetBeans . If you have no Java platform on your system , download from here (which contains JDK+NetBeans ) .
When clicking this , we get :
We will get a window as shown below :
Click ; File--> New Project.
Then we can see,
Select JAVA from Categories; and JAVA APPLICATION from Projects.
Click , Next .
Then , another window will appear as :
Give a project name , and click Finish.
Then we can see the NetBeans IDE for typing the program.It will look like ;
In our program , we need to type the last println statement only.
The sentenses like /**/ does not tken by the Compiler.So, no need to bother about the extra sentenses you see there.
After typing the println statement to display "Hai....Welcome..." , we have to run it.
right click on the page , and select Run the File , from the drop down menu( or , select from the main menu....or , you can use ShiftF6).
The output will displayed in the bottom....as ;
=========================================================================
(B) : Familier with ECLIPSE platform:
When clicking this , we get :
After giving the details as done before , we can see the
Eclipse IDE for typing the program.
I just did the programs and you can see the output there.
(It is also more or less same as
NETBEANS , so i just skip the steps for taking the Eclipse IDE here....)