[email protected]
把源代码给我

解决方案 »

  1.   

    你这样是调用父类的无参构造函数!!!所以你只需要用隐式的调用父类的无参构造函数!!!所以不用写super();这句就可以了!!!应该是这样!!!:)个人见解!!!
      

  2.   

    还是我!!!又发现问题!!!你的代码中!!!定义构造函数MineMap()时不应带void!!!把它去掉编译通过!!!所以我推翻了我的上贴!!!
      

  3.   

    不会吧,,构造函数还用VOID,,
    ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
    无语
      

  4.   

    import javax.swing.*;
    import java.awt.*;public class MineMap extends JPanel {
    int mapWidth,mapHeight,mineNumber;
    public MineMap (int width , int height, int number){
    super();
    mapWidth = width;
    mapHeight = height;
    mineNumber = number;
    this.setSize (mapWidth * 20, mapHeight * 20);
    this.setLayout (null);
    }
    }
    这样没有问题
      

  5.   

    void MineMap()  构造函数没有返回类型
      

  6.   

    子类调用父类是可以的,但在构造方法中是没有类型的,即直接使用public constructormethod(...)即可
      

  7.   

    太好了!问题解决了,谢谢各位高手的大力协助。到底是CSND的高手,1天就解决问题!哈哈哈哈
    看来我要经常来这里。
      

  8.   

    构造方法只能使用public,protected,private修饰