Class Palindrome

java.lang.Object
  extended by Palindrome

public class Palindrome
extends java.lang.Object

The Palindrome Java application illustrates the use of a stack and a queue in the same program to determine whether a line is a palindrome. The program ignores everything except alphabetic letters, and it ignores the difference between upper- and lowercase letters.

Java Source Code for this class:
http://www.cs.colorado.edu/~main/applications/Palindrome.java


Constructor Summary
Palindrome()
           
 
Method Summary
static boolean is_palindrome(java.lang.String input)
          The return value is true if and only if the input string is a palindrome.
static void main(java.lang.String[] args)
          The main method prompts the user for a strings.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Palindrome

public Palindrome()
Method Detail

main

public static void main(java.lang.String[] args)
The main method prompts the user for a strings. Each string is read and checked to see whether it is a palindrome. The program ends when the user enters an empty line (just the return key).


is_palindrome

public static boolean is_palindrome(java.lang.String input)
The return value is true if and only if the input string is a palindrome. All non-letters is ignored, and the case of the letters is also ignored.