display the fifth character in a string in a single statement
Answers
Answer:
The Java String charAt(int index) method returns the character at the specified index in a string. The index value that we pass in this method should be between 0 and (length of string-1). For example: s. charAt(0) would return the first character of the string represented by instance s.
Explanation:
You can certainly make a string equal a single character if you wish, it takes more overheard from resources but, it's certainly do able, this would unlock many methods on that string as well.
Answer:
The Java String charAt(int index) method returns the character at the specified index in a string. The index value that we pass in this method should be between 0 and (length of string-1). For example: s. charAt(0) would return the first character of the string represented by instance s.