import java.awt.*;
import java.applet.*;class A
{
int x;
public A(int x)
{
this.x=x;
}
}class B extends A
{
float y;
public B(int x ,float y)
{
super(x);
this.y=y;
}
}public class Applet1 extends Applet
{
char ch='a';
B b=new B(100,12.3f);
// public void paint(Graphics g)
// {
// g.drawString(b.x+" "+b.y+" "+ this.ch,20,30);
// g.drawString("asd",20,30);
// }
public static void main(String args[])
{
Applet1 a = new Applet1();
a.display();
}
public void display()
{
System.out.println (b.x+" "+b.y+" "+ this.ch);
}
}
import java.applet.*;class A
{
int x;
public A(int x)
{
this.x=x;
}
}class B extends A
{
float y;
public B(int x ,float y)
{
super(x);
this.y=y;
}
}public class Applet1 extends Applet
{
char ch='a';
B b=new B(100,12.3f);
// public void paint(Graphics g)
// {
// g.drawString(b.x+" "+b.y+" "+ this.ch,20,30);
// g.drawString("asd",20,30);
// }
public static void main(String args[])
{
Applet1 a = new Applet1();
a.display();
}
public void display()
{
System.out.println (b.x+" "+b.y+" "+ this.ch);
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货