This discussion is archived
5 Replies Latest reply: Jan 30, 2013 3:08 AM by EJP RSS

Stupid question about package

959503 Newbie
Currently Being Moderated
I read information about "PACKAGE" from website , it mentions package=directory.
should I create folder corresponding to package before I complie .java and put .java file in the folder ?
Actually I did as I mention above, and java compiler return me a error message "class name, demoa, are only accepted if annotation processing is explicitly requested". following are source code from demoa.java:

package samplepackage;
public class demoa
{
public void demoashowmsg()
{
System.out.println("Here is demoa!");
}
}

The second issue bother me is,should I put all class which belong to the same package in the same .java file ?
should I declar "package PackageName" before every class?

Thanks to those who reply and help in advance.

Best Regards
tom

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points