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 ...
随机推荐
- Flink学习(十九) 容错机制
主要内容: 一致性检查点(checkpoint) 从检查点恢复到状态 Flink检查点算法 保存点(savepoint) 一致性检查点(checkpoint) Flink故障恢复机制的核心,就是应用状 ...
- Zookeeper、Hadoop、Hbase的启动顺序以及关闭顺序
启动顺序 Hadoop及hbase集群启动顺序 zookeepeer -> hadoop -> hbase 停止顺序 Hadoop及hbase集群关闭顺序 hbase -> hado ...
- Vue2框架-基础
1. vue简介 什么是vue? Vue是一套用于构建用户界面的渐进式JavaScript框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库只关注视图层,方便与第三方 ...
- TypeScript 为什么使用 Go 而不是 Rust 重写 ?官方回应来了
TypeScript官推最近宣布他们正在移植到 Go,速度已经提高了 10 倍之多. 作为以性能为代表的另一语言Rust,人们自然会疑惑为什么没有选Rust语言重构呢?为方便大家快速理解,我用Deep ...
- directory 用于数据泵 导入、导出创建的目录。
1.查询directory目录 select * from dba_directories; 2.创建或者修改 directory目录 create or replace directory 目录名称 ...
- 汇编概念辨析(Intel/AT&T syntax、GAS、NASM)
写在前面 本文并不详细介绍Intel syntax.AT&T syntax.GAS.NASM的具体内容和具体区别,而是从概念辨析的角度说明这些专有名词的含义,以便为初学者扫清疑惑.有兴趣深入了 ...
- 使用 PHP 创建 Excel 读取器类
介绍: PHPExcel-1.8.1读取excel 创建 ExcelReader 类: ExcelReader 类旨在从 Excel 文件中读取数据.它以文件路径作为输入,并提供一个方法来从 Exce ...
- 字符串成员方法:截取、替换、切割 及String成员方法小结
1.截取 subString() subString()方法有两种使用方式: 1.第一种是在括号里只放入一个索引,这时将会从放入的索引为起点,一直截取到末尾 2.第二种是在括号里放入两个索引,分别对应 ...
- Oracle PLSQL 存储过程无法进入单步调试
使用PLSQL工具调试存储过程的时候,不管你怎么设置断点,当你点击测试的时候就瞬间执行而过你无法进入单步调试 解决办法:
- 如何定位 Druid & HikariCP 连接池的连接泄漏问题?
背景 最近碰到一个 case,一个 Java 应用无法获取新的数据库连接,日志中出现了以下错误: com.alibaba.druid.pool.GetConnectionTimeoutExceptio ...