当前位置:网站首页>解决C#非静态字段、方法或属性“islandnum.Program.getIslandCount(int[][], int, int)”要求对象引用
解决C#非静态字段、方法或属性“islandnum.Program.getIslandCount(int[][], int, int)”要求对象引用
2022-08-02 06:01:00 【xqlily】
在c#里面运行一段二维数组的代码:
在主函数main里调用了下面这个代码时
getIslandCount(map, row, col);报错标题中的错误:
非静态字段、方法或属性“islandnum.Program.getIslandCount(int[][], int, int)”要求对象引用
在main函数之前是如下定义这个函数的:
public int getIslandCount(int[][] map, int row, int col)那么只需把上面这行代码改为:
public static int getIslandCount(int[][] map, int row, int col)错误就解决了,就是只加一个static就可以了。
边栏推荐
- MySQL经典50道练习题及全网最详细解析
- Nodejs installation and global configuration (super detailed)
- 引领需求 为HR价值正名——“人力资源领先模型HRLM”成功首发
- MySQL高阶---存储引擎、索引、锁
- Nacos客户端启动出现9848端口错误分析(非版本升级问题)
- 2022年7月18日-7月31日(Ue4视频教程和文档,20小时。合计1412小时,剩8588小时)
- [数据集][VOC]眼睛佩戴数据集VOC格式6000张
- SphereEx苗立尧:云原生架构下的Database Mesh研发实践
- CAT1 4G+以太网开发板腾讯云手机微信小程序显示温度和下发控制
- Leading the demand and justifying the HR value - the successful launch of the "Human Resource Leading Model HRLM"
猜你喜欢
随机推荐
GCC编译器技术解析
Xgboost报错 ValueError: Invalid shape: (1650, 2) for label
Nacos数据库配置
MySQL union query (multi-table query)
Nacos客户端启动出现9848端口错误分析(非版本升级问题)
能与观众实时互动的Claper
Nodejs installation tutorial
BGP+MPLS Comprehensive Experiment
HCIP 第二天
关于ue4.27像素流送打包后的本地服务器问题
MySQL高级SQL语句(二)
MySQL - Multi-table query and case detailed explanation
MySQL Advanced - MVCC (ultra-detailed finishing)
mysql索引失效的常见9种原因详解
DNS resolution process
振兴农村循环经济 和数链串起农业“生态链”
Py's mlxtend: a detailed guide to the introduction, installation, and usage of the mlxtend library
Ue after video tutorial first
npm does not recognize the "npm" item as the name of a cmdlet, function, script file, or runnable program.Please check the spelling of the name, and if the path is included, make sure the path is corr
Understand C operators in one article






![[数据集][VOC]眼睛佩戴数据集VOC格式6000张](/img/66/37f76d9ce5d5f68d6ea0e18710fa04.png)


