Sail E0 Webinar
Question
Select the appropriate code which tests for a palindrome.
Options:
A .  public static void main(String[] args) {
B .  public static void main(String[] args) {
C .  public static void main(String[] args) {
D .  None of the mentioned
Answer: Option A


Push all the characters in the input string to a stack, now pop them and append to a new string which is checked for equality with the original string.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :

Latest Videos

Latest Test Papers