Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Can packages and classes have same name?
|
Posted: Mar 10, 2003 5:50 PM
|
|
|
It is possible to do, but would be a violation of the accepted convention. The words in class names are capitalized, by convention, whereas package names are normally all lower case (this was not true with the first release of Java, but it is now). So in your example, the package would be jackal and the class would be Jackal. There are other reasons that this is unlikely to occur in professional code, such as the fact that the package is normally a company's or organization's "reversed" url or pseudo-url, as in com.suiterunner.Suite.
|
|