itwanger / toBeBetterJavaer

一份通俗易懂、风趣幽默的Java学习指南,内容涵盖Java基础、Java并发编程、Java虚拟机、Java企业级开发、Java面试等核心知识点。学Java,就认准二哥的Java进阶之路😄
https://javabetter.cn
13.45k stars 1.9k forks source link

Java进阶之路P159页字符串的substring注释结果有误 #113

Open TheGreatHaige opened 5 months ago

TheGreatHaige commented 5 months ago

原: String str = "Hello, world!"; String prefix = str.substring(0, 5); // ᨀ 取前5个字符,即 "Hello,"

改: String str = "Hello, world!"; String prefix = str.substring(0, 5); // ᨀ 取前5个字符,即 "Hello"