Question
Select the appropriate code which reverses a word.
Answer: Option B
Was this answer helpful ?
Although, it is possible to reverse the string without using stack, it is done by looping through the string from the end character by character.
In Java, it is also possible to use the StringBuilder and StringBuffer classes which have a built-in method 'reverse'.
Note its similarity to PalindromeTest
Was this answer helpful ?
Submit Solution