String Quote by Eric Freeman
““If you give it an index that is greater than or equal to the length of the string, it returns the empty string.””
About This Quote
Source Book: Head First Java, Kathy Sierra & Bert Bates, 2003
When an index exceeds string length, the method returns an empty string, preventing errors.
In simple terms: Out‑of‑range index gives empty result.
Check bounds before accessing strings.
Themes
Mood
Type
When to use this quote
- user input validation
- API documentation
- debugging sessions
Key Concepts
Questions to Reflect On
- How do you handle out‑of‑range cases?
- When is returning empty appropriate?
Returning empty may hide bugs.