编译器报错The type of the expression must be an array type but it resolved to int.
代码编写过程中报错The type of the expression must be an array type but it resolved to int. 说明一个int类型的变量被当作了数组类型array来处理。
检查代码:
public static int InsertValueSearch(int arr, int left, int right, int findVal) {if( left > right || findVal < arr[0] || findVal > arr[arr.length-1]) {return -1;}int mid = left + (right - left) * (findVal - arr[left])/(arr[right] - arr[left]);int midVal = arr[mid];
发现arr初始的类型错误,改为
public static int InsertValueSearch(int[] arr, int left, int right, int findVal)
报错消失。
其他地方的这个报错应该也是相同的问题,或者是[]符号没有打对。
编译器报错The type of the expression must be an array type but it resolved to int.相关推荐
- find命令报错: paths must precede expression(转)
转自:find命令报错: paths must precede expression 在一天早上,想在服务器 /tmp 目录清除一些pdf文件,大概一万多个文件,在执行命令的时候 find /tmp ...
- SAP WM 采购订单收货后LT06报错-No bin types have been assigned to storage unit type IP-
SAP WM 采购订单收货后LT06报错-No bin types have been assigned to storage unit type IP- 1,如下的storage type Z03, ...
- tomcat 报错 Status 500 - Mapper method ‘xxxxx‘ has an unsupported return type: class xxx
myBatis 接口写了 insert ,对应的dao层里写的返回值是一个实体类 User add(User user); 报错 Status 500 - Mapper method 'xxxxx' ...
- Debezium报错处理系列九:“ddl“ : “# Dummy event replacing event type 160 that slave cannot handle.“
Debezium报错处理系列九:"ddl" : "# Dummy event replacing event type 160 that slave cannot han ...
- **Gcc编译器报错:gcc -m32报错**
Gcc编译器报错:gcc -m32报错 :/work/printf_myself$ gcc -m32 -o push_test push_test.c In file included from /u ...
- python编译器报错:“RecursionError: maximum recursion depth exceeded in comparison”解决方案
python编译器报错:"RecursionError: maximum recursion depth exceeded in comparison"解决方案 在使用递归迭代语句 ...
- 报错Field Mapper in xxx.xxxServiceImpl required a bean of type ‘dao.xxxMapper‘ that could not be found
报错Field Mapper in xxx.xxxServiceImpl required a bean of type 'dao.xxxMapper' that could not be found ...
- 解决find命令报错: paths must precede expression
执行下面命令 find . -name *.sh 报错 find: paths must precede expression 解决方案:多文件的查找的时候需要增加单引号 改为 find . -nam ...
- java报错“Syntax error on tokens, delete these tokens”、“Return type for the method is missing”
今天从wps里复制了java代码,出现了报错, Syntax error on tokens, delete these tokens;Return type for the method is mi ...
最新文章
- Java 线程状态之 TIMED_WAITING
- beego 优雅重启
- 崩溃!新浪程序员加班错失 77 万年会大奖
- 交换机工作原理_交换机你了解它吗?它工作原理是这样的
- 串口通信中ReadFile和WriteFile的超时详解!
- python 自动回收机制
- python对日志处理的封装
- Effective Objective-C 的读书笔记
- STM32F207时钟系统解析
- input框输入的文本类型都是字符串类型
- MATLAB读取Execl数据并绘制曲线图
- 适用于Android手机的汉信码识别SDK
- 浏览器地址栏输入url到显示主页的过程
- linux中权限sudo,Linux中sudo权限(下)
- 苹果手机sim卡无效怎么办_苹果手机解锁密码忘了怎么办
- 当 AI 邂逅绘画艺术,能迸发出怎样的火花?
- 四年级学生学情分析计算机,四年级小学信息技术教学计划
- 检测手机是否root
- i.MX6ULL开发板【终结者】硬件资源说明
- 手撸一款Android屏幕适配SDK
热门文章
- 生成token的工具类
- 计算机在我们的生活中越来越重要英语,职业高中高一下学期期末英语试题卷5(含答案)...
- 网络通信技术(TCP/IP)
- Camera Self-Calibration: Theory and Experiments
- 计算机二级办公软件的函数,《计算机二级办公软件常用excel函数》.doc
- gitblit中忘记admin密码,怎么办?附详细解决方法和截图
- 数字图像处理习题(一)
- mapbox基本使用
- zabbix结合qqmail发送故障信息
- 2022年618活动4000价位笔记本推荐