package meizu1;
import com.mei.*;
public class Meizu {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("是");
}}
我导入下面的包,但运行的还是原代码,怎么解决呢?
package com.mei;
public class Meizu {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("不");
}
}
package zwei;
import com.mei.Meizu;
public class Zwei {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println("你好");
}}
我修改了,还是运行不了,依然运行得是(你好),在导入包的代码那还是提示
(The import com.mei is never used)
package com.mei;
public class Meizu {
public Meizu(){
System.out.println("不");
}
}
一个项目中只能存在一个public修饰的main函数,作为程序的访问入口。