Saturday, December 13, 2008

Simple java program to understand compiling and running a program inside a package

/*---------------------------------------------------------------------------------------
Simple java program to understand compiling and running a program inside a package
---------------------------------------------------------------------------------------*/
package javaprogs.basic;

class helloworld{

public static void main(String args[]){

System.out.println("Helloworld in basic package");

}

}
/*
---------------------------------------------------------------------------------------
Output of compiling and running a package
---------------------------------------------------------------------------------------
C:\Users\flower\Documents\javaprogs\basic>javac helloworld.java

C:\Users\flower\Documents\javaprogs\basic>cd ..

C:\Users\flower\Documents\javaprogs>cd ..

C:\Users\flower\Documents>java javaprogs.basic.helloworld
Helloworld in basic package
*/

No comments: