Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

package

 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
venkatesh badrinathan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr.Mohammed.. i ve got that right
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's Miss
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic