小编yan*_*819的帖子

为什么还需要错误返回类型?

我想在之前的函数中绘制一条线.因此,我需要一个返回函数,因此在图形函数中绘制线条更加顺畅.

我很困惑,为什么还有错误,因为我放了返回功能.请帮我..

"Program.java:45:无效的方法声明;需要返回类型"

   public static SLL(int SLL)

   public Program()
  {
     super("MyProgram"); //window name
     .....
     computeButton.addActionListener(this);
  }


   public void actionPerformed(ActionEvent ee)
  {
  }
   public static SLL(int SLL)
  {  ....

     HomePosition HP[][] = new HomePosition[2][6];
     HomePosition DP[][]= new HomePosition[2][6];
     HomePosition FB[][] =new HomePosition[2][6];
     ...
     FB[1][0].x= FB[2][0].x=40;
     FB[1][0].y=FB[2][0].y=40;

     HP[1][0].x = 40;       HP[1][0].y = 30;        
     HP[1][1].x = 26;       HP[1][1].y = 30;       


     DP[1][0].x = 30;           DP[1][0].y =40;    
     DP[1][1].x = 16;           DP[1][1].y = 40;   

     SLL.SLx[m][n]=HP[m][n].x;

     return SLL;
  }

   public void paint(Graphics g) {
     super.paint(g);      
     }


      BasicStroke …
Run Code Online (Sandbox Code Playgroud)

java

-1
推荐指数
1
解决办法
588
查看次数

标签 统计

java ×1