在EditPlus 3上运行,编译时没有出现错误,执行时出现Exception in thread "main" java.lang.NoClassDefFoundError:就是不出结果。
本来以为是编译时出现错误可是当我用cmd运行时,发现出现错误出在编译上,因为我的程序中有错误
各位高手知道的帮帮忙!!!急求!!!

解决方案 »

  1.   

    public class TestArry 
    {
       public static void main(String[] args)
       {
            Date[] days;
            days = new  Date[3];
             for(int I = 0; I < 3; i++)
     {
                   days[i] = new Date(2010,10,i+1);
              }
        }   
    }
    public class Date
    {
         int year;int month; int day;
         Date(int y,int m,int d) 
     {
    year = y;  month = m;  day = d;
         }
    }
      

  2.   

    回复xiaoye2892  谢谢了!!!!
      

  3.   

    如果2个class在不同的文件里,是没有问题的.
    如果在同一个文件里肯定编译不通过
      

  4.   

    把public class Date改成class Date就行了!
      

  5.   

    两个public类,把下面的public去掉~
      

  6.   

    +1 确实一个java文件中只能有一个public class  。
      

  7.   

    只能有一个主类,去掉一个public