我正在研究这个代码,并希望打印一个矩阵,但那就是出现了什么
Matrix@2c78bc3b Matrix@2a8ddc4c
这是一个代码示例:
public class Matrix
{
public static int rows;
public static int colms;//columns
public static int[][] numbers;
public Matrix(int[][] numbers)
{
numbers = new int[rows][colms];
}
public static boolean isSquareMatrix(Matrix m)
{
//rows = numbers.length;
//colms = numbers[0].length;
if(rows == colms)
return true;
else
return false;
}
public static Matrix getTranspose(Matrix trans)
{
trans = new Matrix(numbers);
for(int i =0; i < rows; i++)
{
for(int j = 0; j < colms; j++)
{
trans.numbers[i][j] = numbers[j][i]; …
Run Code Online (Sandbox Code Playgroud) public abstract ClassName
{
// methods
// setters & getters...???
}
Run Code Online (Sandbox Code Playgroud) 我知道这对于正常的整数,但是对于像指数这样的东西吗?
Random dice = new Random();
int n = dice.nextInt(6);
System.out.println(n);
Run Code Online (Sandbox Code Playgroud)