.java:21: 错误: 方法声明无效; 需要返回类型 public destroy()
importjava.applet.*;importjava.awt.*;publicclassSmp72extendsApplet{intx,y;intininmb=0...
import java.applet.*;
import java.awt.*;
public class Smp72 extends Applet
{
int x,y;
int ininmb=0,startnmb=0,stounmb=0,destroynmb=0,paintnmb=0;
public void init()
{
x=40;
y=20;
ininmb++;
}
public void start()
{
startnmb++;
}
public void stop()
{
stopnmb++;
}
public destroy()
{
destroy++;
}
public void paint(Graphics g)
{
paintnmb++;
g.drawString("ininnmb= "+ininmb,x,y);
g.drawString("starnmb= "+start,x,y+20);
g.drawString("stopnmb= "+stopnmb,x,y+40);
g.drawString("destroynmb= "+destroy,x,y+60);
g.drawString("paintnmb= "+paintnmb,x,y+80);
}
}
新手 不知道怎么回事 展开
import java.awt.*;
public class Smp72 extends Applet
{
int x,y;
int ininmb=0,startnmb=0,stounmb=0,destroynmb=0,paintnmb=0;
public void init()
{
x=40;
y=20;
ininmb++;
}
public void start()
{
startnmb++;
}
public void stop()
{
stopnmb++;
}
public destroy()
{
destroy++;
}
public void paint(Graphics g)
{
paintnmb++;
g.drawString("ininnmb= "+ininmb,x,y);
g.drawString("starnmb= "+start,x,y+20);
g.drawString("stopnmb= "+stopnmb,x,y+40);
g.drawString("destroynmb= "+destroy,x,y+60);
g.drawString("paintnmb= "+paintnmb,x,y+80);
}
}
新手 不知道怎么回事 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询