Topic: 大家看看这个程序错在哪了?谢谢了!

  Print this page

1.大家看看这个程序错在哪了?谢谢了! Copy to clipboard
Posted by: jakiey
Posted on: 2005-03-30 18:24

请尽量用准确的文字描述作为标题
e.g. the error message on compiling




class Utensil{
   Utensil(){
    System.out.println("Utensil constructor");
  }
}

class Spoon extends Utensil{
public Spoon (){
    super();
    System.out.println("Spoon constructor");
  }
}

public class test extends Spoon {

test (){
  super();
  System.out.println("test constructor");
}

  public static void main(String[] args) {
    test x=new test();
   x.Spoon();
  }  
}

2.Re:大家看看这个程序错在哪了?谢谢了! [Re: jakiey] Copy to clipboard
Posted by: why
Posted on: 2005-03-30 21:23

I suppose there's an error at
x.Spoon();

Spoon() is the constructor, and shouldn't be called like that.

3.Re:大家看看这个程序错在哪了?谢谢了! [Re: jakiey] Copy to clipboard
Posted by: jakiey
Posted on: 2005-03-31 08:51

I see ,than you!

4.Re:大家看看这个程序错在哪了?谢谢了! [Re: jakiey] Copy to clipboard
Posted by: wddodo
Posted on: 2005-04-02 14:52

构造函数不能被继承。

5.请问Jcreator中怎样显示中文 [Re: jakiey] Copy to clipboard
Posted by: zyg108
Posted on: 2005-04-06 08:33

请问Jcreator中怎样显示中文,E-MAIL:ZYG108.163.COM?谢谢了!

6.Re:大家看看这个程序错在哪了?谢谢了! [Re: jakiey] Copy to clipboard
Posted by: dengyinjun
Posted on: 2005-05-25 03:35

把x.Spoon();
这行,给注解掉,就行了


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923