【发布时间】:2013-02-11 10:38:34
【问题描述】:
我想构建一个程序来操作多维数组,这是我想学习的一个新概念......
我认为它可能有几种方法...
public int get(int row, int column)
// a method to get the value in row/column
// keep in mind columns/rows start at 0
public void set(int row, int column, int value)
// a method to set the matrix element to the value
// again keep in mind columns/rows start at 0
public void negate()
// method that negates through each element
public void add(Matrix m)
// adds the matrix m to this
谁能告诉我这是否是正确的方法,我该怎么做? 提前致谢
【问题讨论】:
-
听起来不错。您是在询问要使用哪种数据结构,或者您将如何实现这些方法?
-
看起来不错,并且您的代码有描述每种方法的注释
-
@chm052 实现它们! :D
-
方法命名取反。这是什么意思?方法名称应该定义方法的功能
-
尝试自己编写程序。如果您遇到问题,请提出问题。
标签: java multidimensional-array matrix