/** * merge: Given two stacks containing Integer objects in increasing order from the bottom up, * create a third stack such that the Integer objects are in decreasing order from the bottom up. * If an item appears n times in the two given stacks, it will appear n times in the new stack. * * @param s1 the first stack * @param s2 the second stack * @return the new stack, with the items from the two given stacks merged. */
To extract individual characters from a String, it calls the charAt method that is predefined in the String class, as follows:
char charAt(int index)
// Returns the char value at the specified index.
Modify the checkPalindrome method of Palindrome so that it uses the predefined Stack class (a generic class in the Java Collections Framework); see example using this Stack class.