Computer Science, asked by piyushTiwari7056, 8 months ago

display the fifth character in a string in a single statement

Answers

Answered by mysteries27
0

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.

Answered by Subham200813
0

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.

Similar questions