开发者

multilevel java packages

how do i define multilevel packages in java

package foo;

one level package

package foo[开发者_运维问答.1oo[.2oo]];

doesn't work.


It doesn't work because package names must start with a letter. This works:

package foo.bar.baz;

N.B. package names aren't hierarchical or nested in the way that they might look. A package name is simply an identifier for a namespace. That means that package foo.bar.baz is not truly a subpackage of package foo.bar.

See also:

  • The Java Tutorial: What is a package?
  • The Java Tutorial: Creating and Using Packages
  • http://en.wikipedia.org/wiki/Java_package
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜