防止类重名
包名命名规则
- 所有字母小写
- 域名倒过来写
一个类的全名
“包名”+”.”+”类名”
public class Test { public Test() { // TODO Auto-generated constructor stub } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("包测试"); } }
编译运行
定义包
package top.zxc; public class Test { public Test() { // TODO Auto-generated constructor stub } public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("包测试"); } }