正在加载图片...
void paint( Graphics g) ("你好!",10,20);} 3)下面是用户程序对 Applet类中方法 action()的重新定义,功能为从单行文本编辑 区 Input中输入数据赋给k。 TextField类的对象 Input和int型变量k已在类体中正确 说明 i if(e. target==input xt(): repaint() return true 7.请指出下面程序中的错误。 public class Test extends Base public static void main(String args) Test t=new Testo Test t2=new Test("TestName"); class base System. out. printIn("Base Constructor") Base( string name his name nameJava 程序设计 - - 7 - __________ void paint(Graphics g) { g.____________("你好!",10,20); } 3).下面是用户程序对 Applet 类中方法 action( ) 的重新定义,功能为从单行文本编辑 区 input 中输入数据赋给 k。TextField 类的对象 input 和 int 型变量 k 已在类体中正确 说明。 public ___________ action( Event e, Object o ) { if( e.target==input ) k=Integer.parseInt( _______.getText( ) ); repaint( ); return true; } 7. 请指出下面程序中的错误。 public class Test extends Base { public Test() { super(); } public static void main(String[] args) { Test t = new Test(); Test t2 = new Test("TestName"); } } class Base { String name; Base() { System.out.println("Base Constructor"); } Base(String name) { this.name = name; } }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有