前面加an的元音音素:编译通过了,但无法运行,java.lang.NoClassDefFoundError,求助

来源:百度文库 编辑:高考问答 时间:2024/04/25 22:06:23
class Lesson22
{
public static void main(String args[])
{
int x=0;
try
{
x =System.in.read();
}catch(Exception e){}
while(x !='q')
{
System.out.println((char)x);
try
{
x =System.in.read();
}catch(Exception e){}
}
}
}
运行后出现错误:
Exception in thread "main" java.lang.NoClassDefFoundError: lesson22 (wrong name:
Lesson22)
谢谢大家帮忙了

类定义前面加public的要

第一行改为:
public class Lesson22