笔者源码如下:

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相关推荐

  1. Excel 导入数据库中java.lang.StringIndexOutOfBoundsException: String index out of range: -50提示解决原因...

    dbf文件另存为.xls然后导入到sql数据库里会报错. java.lang.StringIndexOutOfBoundsException: String index out of range: - ...

  2. java.lang.StringIndexOutOfBoundsException: String index out of range: 0错误的原因

    2019独角兽企业重金招聘Python工程师标准>>> java.lang.StringIndexOutOfBoundsException: String index out of ...

  3. java.lang.StringIndexOutOfBoundsException: String index out of range: -1

    在这里插入代码片 package com.itheima.d3_char_buffer; import java.io.*; import java.util.ArrayList; import ja ...

  4. springBoot-tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String inde

    springBoot-tk.mybatis.mapper.MapperException: java.lang.StringIndexOutOfBoundsException: String inde ...

  5. Caused by: java.lang.StringIndexOutOfBoundsException: length=5; regionStart=0; regionLength=-1

    Caused by: java.lang.StringIndexOutOfBoundsException: length=5;regionStart=0; regionLength=-1 原因:在截取 ...

  6. String index out of range: -4 错误解析

    报这个错误是由于对字符串进行操作的过程中抛出了StringIndexOutOfBoundsException异常 下面的几种方法均有可能抛出上述异常: String.substring() Strin ...

  7. java.sql.SQLException: Parameter index out of range (4 number of parameters, which is 2).

    背景: 在使用多线程测多个基站(一个基站下面多个手卡)的数据,虽然数据都接受没有问题,但是报了这个错误. java.sql.SQLException: Parameter index out of r ...

  8. java.lang.IllegalArgumentException: Path index does not start with a / character

    java.lang.IllegalArgumentException: Path index does not start with a "/" character 最近用stru ...

  9. java.sql.SQLException: Parameter index out of range (5 > number of parameters, which is 4).

    问题描述: 启动项目调接口的时候控制台报错 Cause: java.sql.SQLException: Parameter index out of range (5 > number of p ...

最新文章

  1. 省钱之道--图解域域树域林根域的含义
  2. 解释@Component @Controller @Service @Repository
  3. [No000039]操作系统Operating Systems用户级线程User Threads
  4. 180.4. WebSphere Commerce Engerprise 7.0 Feature Pack 2.iso
  5. 海康威视:国际化+互联网 公司迎来“第二春”
  6. 2013年4月计算机一级试题 答案,9月计算机一级考试试题含答案
  7. CUBA平台–新的Java企业应用程序框架
  8. 【渝粤教育】国家开放大学2018年秋季 0273-22T中国现代文学 参考试题
  9. [SQL] 请教一下 count里面有case when 一般情况下啥时候用
  10. ArcGIS API for JavaScript:Layer之间那点儿事
  11. Java 基础系列:异常
  12. Django 聚合(译)
  13. 利用Calendar类判断是平年还是闰年
  14. java 遍历json串_Java遍历Json数据
  15. Quora cqa问题抓取
  16. 防干扰继电器控制电路
  17. 初体验之rawkv learner recover灾备切换
  18. Could not autowire. No beans of xxx 解决办法
  19. 视觉C-部分技术文档
  20. 使用Python操控手机微信app(最新教程)

热门文章

  1. 原来微信视频号视频保存到本地这么简单
  2. 分公司能与员工签劳动合同么
  3. 3d量测怎么学距离_零基础学习3D建模用这几种方法,学习效率提升没毛病
  4. iphone导出照片到pc_如何轻松地将照片从PC传输到iPhone,iPad或iPod
  5. ASP.NET Web程序设计——WebPages
  6. 集合转数组 数组转集合
  7. date的oracle格式,Oracle的默认date格式是YYYY-MM-DD,为什么?
  8. 智能家居手势识别,只需百度AI即可搞定
  9. python中使用turtle画了一张表情包——五一假期第一天
  10. php中表格间距代码,css:border-spacing属性(表格边框间距)的示例代码分享