java - 如何在Java中的二维字符数组的mutator(setter)方法中传递值?
问题描述
所以我创建了这个方法,
public void setarray(char[][]a)
{
board=a;
}
并希望通过我的 Main 函数在 2D 数组中传递值 3 和 3。
test.setRow(3);
test.setCol(3);
test.setarray[][]
基本上,设置为 3 的 Row 和 Col 值应该由该数组使用。
我怎么做?我收到一个错误。
解决方案
推荐阅读
- python - Python:如何从包含路径的 excel 文件中生成目录?
- smartcontracts - 获取通过智能合约发送到地址的 BUSD 反射
- api - 我可以在两个 Facebook 应用程序之间共享请求限制吗?
- angular - Laravel 中间件授权问题
- nestjs - PrismaService 上的 Nestjs OnModuleInit 错误
- python - “AttributeError:模块'tweepy'没有属性'StreamListener'”与Python 3.9
- python - 在自己的类中使用来自 pandas 的 iloc 和 loc
- html - 为什么图像的背景位置会有偏移?
- php - 将浮点数添加到 Json Obj 不正确的小数
- c# - 物体运动时如何让粒子出现?