当前位置:网站首页>解决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高阶---存储引擎、索引、锁
- Analysis of the source code of the JS UI framework of Hongmeng system
- Write implicit join on view with jOOQ 3.14 synthetic foreign key
- 两篇不错的php debug教程
- ASP.NET Core Web API 幂等性
- How the Internet of Things is changing the efficiency of city operations
- MySQL 5.7 安装教程(全步骤、保姆级教程)
- MySQL 23道经典面试吊打面试官
- MySql 5.7.38下载安装教程 ,并实现在Navicat操作MySql
- MySQL high-level statements (1)
猜你喜欢

MySQL - Multi-table query and case detailed explanation

蚂蚁三面:MQ 消息丢失、重复、积压问题,有哪些解决方案?

MySql 5.7.38 download and installation tutorial, and realize the operation of MySql in Navicat

Node installation and environment variable configuration

leetcode solves the linked list merge problem in one step

MySQL高级SQL语句

Toolbox App 1.25 New Features at a Glance | Version Update

Not annotated parameter overrides @NonNullApi parameter

MySQL Advanced Statements (1)

GCC编译器技术解析
随机推荐
一文搞懂C操作符
chrome plugin development guide
8/1 思维+扩展欧几里得+树上dp
MySQL高级语句(一)
Xgboost报错ValueError:无效的形状:标签(1650 2)
MySQL高级-MVCC(超详细整理)
Nacos installation detailed process
leetcode solves the linked list merge problem in one step
Py's mlxtend: a detailed guide to the introduction, installation, and usage of the mlxtend library
Servlet
Not annotated parameter overrides @NonNullApi parameter
nacos安装配置和单机部署教程
Nacos数据库配置
SphereEx苗立尧:云原生架构下的Database Mesh研发实践
推出 Space On-Premises (本地部署版) Beta 版!
nacos源码启动找不到istio包
【npm install 报错问题合集】- npm ERR! code ENOTEMPTY npm ERR! syscall rmdir
Practice on optimizing startup performance of VS Code
In-depth analysis of the initialization of member variables and local variables
MySql统计函数COUNT详解