java.lang.StringIndexOutOfBoundsException: String index out of range: 1
笔者源码如下:
package javaPractice;
import java.util.*;
public class TestScanner {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
ArrayList<Character> a = new ArrayList<Character>();
int i = 0;
while(str.charAt(i)!='#') {
a.add(str.charAt(i));
System.out.println((int)a.get(i));
i ++;
}
sc.close();
}
}
//先占个坑,小陌早晚会解决的
java.lang.StringIndexOutOfBoundsException: String index out of range: 1的更多相关文章
- java.lang.StringIndexOutOfBoundsException: String index out of range: 0
hibernet 报错 java.lang.StringIndexOutOfBoundsException: String index out of range: 0 处理方法 数据表字段为char ...
- Spring Boot 启动报错 Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 37
使用命令 java -jar springBoot.jar 启动项目,结果报错如下: Exception at java.lang.String.substring(String.java:) at ...
- tk.mybatis 报错:tk.mybatis.mapper.MapperException: tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'apiLogMapper ...
- hibernate createSQLQuery StringIndexOutOfBoundsException: String index out of range: 0
有一个sql用union拼接的如下: select id,(**还有很多字段**),'' as NewName from tb1 union select id,(**还有很多字段**),name a ...
- Springboot+Mybatis:启动报错 String index out of range: -37
springBoot+Druid+Mybatis :启动错误描述 Error parsing SQL Mapper Configuration. Cause: java.lang.StringInde ...
- java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).
java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). java. ...
- Caused by: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0
1.错误描述 [ERROR:]2015-05-05 16:35:50,664 [异常拦截] org.hibernate.exception.GenericJDBCException: error ex ...
- java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0).
java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at co ...
- listview 遇到问题java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
开发的时候 遇到 java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 这个异常有时候会有,有时候正常 不太好捕捉 猜测 已经 ...
- java.sql.SQLException:Column Index out of range,0<1
1.错误描述 java.sql.SQLException:Column Index out of range,0<1 2.错误原因 try { Class.forName("com.m ...
随机推荐
- Week08_day07(DataX从mysql上读取数据传输到HDFS上)
简介DataX 是阿里巴巴集团内被广泛使用的离线数据同步工具/平台,实现包括 MySQL.Oracle.HDFS.Hive.OceanBase.HBase.OTS.ODPS 等各种异构数据源之间高效的 ...
- 6. Calcite添加自定义函数
1. 简介 在上篇博文中介绍了如何使用calcite进行sql验证, 但是真正在实际生产环境中我们可能需要使用到 用户自定义函数(UDF): 通过代码实现对应的函数逻辑并注册给calcite sql验 ...
- 【Abaqus】*Solid Section定义复合材料
*SOLID SECTION 介绍 *solid section 用来定义单元的材料属性,材料方向等信息: solid (continuum) elements infinite elements a ...
- GIT 基础操作-初始化
命令行说明 全局设置 git config --global user.name "" git config --global user.email "" 创建 ...
- oracle的IP访问列表
Windows版本Oracle 19c. 在sqlnet.ora中添加下面语句 tcp.validnode_checking=yes tcp.invited_nodes=(127.0.0.1,132. ...
- 业余无线电之配置Orbitron My DDE 自动推送多普勒频率至SDRSharp程序中
配置Orbitron My DDE 推送多普勒频率至SDR (By:BI8EJM) Start Edit Time 2021/8/16 23:03 要实现的功能:通过本次设置,让Orbitron程序自 ...
- 【FAQ】HarmonyOS SDK 闭源开放能力 —Push Kit(10)
1.问题描述: 离线推送,锁屏的时候没有弹出消息,只有下拉在通知中心里面显示.请问是否是正常的? 解决方案: 检查一下是否存在图片风控:https://developer.huawei.com/con ...
- 同一局域网下,远程连接另一台电脑的Mysql数据库
博客地址:https://www.cnblogs.com/zylyehuo/ 参考链接 同一局域网,远程连接别人的Mysql数据库 用电脑A去远程电脑B的数据库,那我们要先在电脑B上设置一下: ste ...
- MQ 如何保证数据一致性?
前言 上个月,我们有个电商系统出了个灵异事件:用户支付成功了,但订单状态死活不改成"已发货". 折腾了半天才定位到问题:订单服务的MQ消息,像人间蒸发一样消失了. 这个Bug让我明 ...
- TidHTTP的post编码,老掉牙的问题
TidHTTP使用post时,需要提交json字符串. 那么采用什么编码,这个问题就头大了.目前xe已经不要考虑编码转换问题.但是.... 我们使用ISuperObject操控json.那么最后提交到 ...