这是person类的文件:
package test.person;
public class Person
{.......这个是person1类的文件
package test.person1;
import test.person.*;
class Person1
{
public static void main( String [] ages)
{ ..............然后我执行person1这个文件,抱错java.lang.NoClassDefFoundError: Person1
Exception in thread "main"
请问这个市什么原英呢? 我想通过在两个不同包下面,实现一个调用另一个.
package test.person;
public class Person
{.......这个是person1类的文件
package test.person1;
import test.person.*;
class Person1
{
public static void main( String [] ages)
{ ..............然后我执行person1这个文件,抱错java.lang.NoClassDefFoundError: Person1
Exception in thread "main"
请问这个市什么原英呢? 我想通过在两个不同包下面,实现一个调用另一个.
import test.person.*;
class Person1
{
public static void main( String [] ages)
{
Person man=new Person(10,"zhang");
man.shout();
System.out.println(Person.a);
try {
System.out.println(man.fun3(3,1));
} catch (Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
}
}package test.person;
public class Person
{
private int age=1;
private String name;
public static int a=2;
public void shout()
{
System.out.println(name+"'s age is"+age);
}
public Person (int x,String y)
{
age=x;
name=y;
}
public Person (String x)
public int fun3(int x,int y) throws Exception
{
return x/y;
}
因为eclipse的原因,在open run dialog 中没有更新类..我重建之后 就好了