子类构造函数未被识别

时间:2015-07-14 20:57:10

标签: java constructor subclass

我正在尝试构造一个子类,并且我得到构造函数未定义的错误?!?!

import java.awt.image.BufferedImage;
import java.io.IOException;
import javax.imageio.ImageIO;

public class LinearAlgebra
{
 public class Matrix
  {
    public int m;
    public int n;
    public float Matrix[][];
    void Matrix(int tempm, int tempn)
    {
      m = tempm;
      n = tempn;
      Matrix = new float[m-1][n-1];
    }

  }
  public static void main(String[] args)
  { 
    LinearAlgebra Geometry = new LinearAlgebra();
    LinearAlgebra.Matrix Rotation = Geometry.new Matrix(3,3);

    System.out.println("hello");
  }

}

抱歉已经离开java一段时间了。我查看了一些java教程,并认为我做的相同,但它不起作用 https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

0 个答案:

没有答案