java报错: 需要class, interface或enum求解啊
package package1;
public class classA
{
public void methodA()
{
System.out.println("methodA()");
}
}
package package2;
import package1.classA;
public class classB
{
public void methodB()
{
classA A=new classA();
A.methodA();
System.out.println("methodB()");
}
public static void main(String args[])
{
classB b = new classB();
b.methodB();
}
} java错误 class enum interface
[解决办法]
package package1;
class classA
{
public void methodA()
{
System.out.println("methodA()");
}
}
public class classB
{
public void methodB()
{
classA A=new classA();
A.methodA();
System.out.println("methodB()");
}
public static void main(String args[])
{
classB b = new classB();
b.methodB();
}
}