InterviewSolution
Saved Bookmarks
| 1. |
Which is the function to get the character present at a particular index in the string?(a) char charAt(index);(b) char charIn(StringName);(c) char charAt(StringName);(d) char charIn(index);I got this question in homework.My enquiry is from String Class in portion Inbuilt Classes of Object Oriented Programming |
|
Answer» RIGHT answer is (a) char charAt(index); The explanation: The function can be called USING dot operator with the string object. Char is the return TYPE of the function to return the character at specified position. The index MUST be an integer value, less than the length of string. |
|