当类和包,重名时,包会报错误:The package aaa.a collides with a type;类也会报警告:The type a collides with a package。
package aaa;
public class a {
}
上述的类名为(aaa.a),下述的包名也为(aaa.a),因此会报上述的错误。
package aaa.a;
public class a {
}
当类和包,重名时,包会报错误:The package aaa.a collides with a type;类也会报警告:The type a collides with a package。
package aaa;
public class a {
}
上述的类名为(aaa.a),下述的包名也为(aaa.a),因此会报上述的错误。
package aaa.a;
public class a {
}