simple java program


I think you all are clear about how to start with java programming with the post i have given early so now here i will try to show to show you how to write the java program to the most basic .

simple Program:

Class Example1
   {
      public static void main(String args[])
        {
          System.out.println(“hellow world”);
         }
    }

after  writing these code in any wordprocessor like notepad save it in the extension .java but the name of the file must be the name of the class given in the program her we have Example1 in the program

then compile the program using the command prompt ,in the command prompt you must go to the path where you have saved the program just written then to compile the program type javac filename here for these program it will be like javac Example1.java so if there is no errors in the program then a new file will be made with the same name as the file we have just made but with the .class extension we call it as the class file .now we will use that class file to execute the program ,so to run the simple java program we have written type  java followed by classfilename for these program it will be like java Example1.These is how we normally run the simple java program

so what do you think isn’t it easy to kick off the java program.so if all the java begineers if you still having problem to understand the basics please leave the comment and let me know the problem you have

Advertisements

About tarasj

hi friends i to blog what i have learned .lets talk and share
This entry was posted in ..BASIC.. and tagged , . Bookmark the permalink.