aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes package Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "package" Watch "package" New topic
Author

package

venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
i have written a java package program and compiled it but could not run it...
can anyone explain me whether a package file be executed or not, because i have tried a lot of package prog but ended in vain..
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by venkatesh badrinathan:
i have written a java package program and compiled it but could not run it...


java package program ? please,can you post your code?
venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
package a;
class prg
{

public static void main(String args[])
{
System.out.println("trying for a package");

}

}
hi this is my simple package program.
i have saved this in a folder named 'a', and i could compile this program but when i run this it shows some exceptions.
whereas when i remove the package statement the prg runs perfectly.
i could not figure out where i have went wrong. help me with this please...

Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
What commands are you using for compiling and running?
Your program will now be referred by the name a.prg
And it should be run from the parent package package.
[ August 04, 2008: Message edited by: Nabila Mohammad ]

The future belongs to those who believe in the beauty of their dreams.Dream BIG!
venkatesh badrinathan
Ranch Hand

Joined: Aug 03, 2008
Posts: 77
Thanks Mr.Mohammed.. i ve got that right
Nabila Mohammad
Ranch Hand

Joined: Nov 05, 2007
Posts: 661
It's Miss
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: package