[英]Exception in thread “timer-0” java.lang.NoClassDefFoundError
[英]Exception in thread “Timer-0” java.lang.NoClassDefFoundError:
我已經將必需的文件(PeriodList類)導入到我的(接口)類中,但是當我運行該程序時,卻遇到了異常:
線程“ Timer-0”中的異常java.lang.NoClassDefFoundError:Interface / PeriodList
PeriodList類位於Interface包中,而Interface類位於com.jtattoo.sample中
這是代碼:
package com.jtattoo.sample;
import Interface.PeriodList;
import javax.swing.*;
import java.awt.*;
public class Interface
{
.
.
.
public static void displays(int s)
{
PeriodList pe=new PeriodList();
}
}
讓我感到奇怪的是:在“ PeriodList pe=new PeriodList();
”行中PeriodList pe=new PeriodList();
沒有錯誤,這意味着NetBeans清除了PeriodList類 ,並且在運行項目后出現了問題。
您確定Interface.PeriodList是正確的類名稱嗎? 要導入不同包中的類,請使用
導入package.package ... package.ClassName;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.