Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Exercise - Palindrome

Write a method which returns true if the string parameter is a palindrome.

Tutorial Details:

Write a method which returns true if the string parameter is a palindrome. A palindrome is any "word" which is the same forward and backward, eg, radar, noon, 20011002... The method should return false if the argument is not a palindrome.

Note: This is declared static because it is doesn't depend on instance variables from the class it would be defined in. It only depends on its parameters. It's declared public only because it might be generally useful.

Info on palindromes
Check out www.palindromes.org if you want to know more about them. This site has lots of amusing examples, eg, "Doc, note I dissent: a fast never prevents a fatness. I diet on cod." or "Drat Saddam, a mad dastard!"


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/data/strings/q-pr-string-using-loops/q-pr-palindrome.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Exercise - Palindrome

View Tutorial:
Exercise - Palindrome

Related Tutorials:

The battle of the container frameworks: which should you use? - JavaWorld - January 1999
The battle of the container frameworks: which should you use? - JavaWorld - January 1999
 
Java Tip 71: Use dynamic messaging in Java - JavaWorld - April 1999
Java Tip 71: Use dynamic messaging in Java - JavaWorld - April 1999
 
Design networked applications in RMI using the Adapter design pattern
Design networked applications in RMI using the Adapter design pattern
 
Enhance your Java application with Java Native Interface (JNI)
Enhance your Java application with Java Native Interface (JNI)
 
Speed up listener notification - JavaWorld February 2000
Speed up listener notification - JavaWorld February 2000
 
Create dynamic images in Java servlets - JavaWorld May 2000
Create dynamic images in Java servlets - JavaWorld May 2000
 
Cache in on faster, more reliable JSPs - JavaWorld May 2001
Cache in on faster, more reliable JSPs - JavaWorld May 2001
 
The art of EJB deployment - JavaWorld August 2001
The art of EJB deployment - JavaWorld August 2001
 
Flex your grid layout
Flex your grid layout
 
Use XML data binding to do your laundry
Use XML data binding to do your laundry
 
Evolve your apps with the Phased Process pattern
Evolve your apps with the Phased Process pattern
 
Publish
Publish event-driven Web content with JSP custom tags
 
A recipe for cookie management
A recipe for cookie management
 
Eclipse casts shadows
Eclipse casts shadows
 
Bridge the gap between Java and Twain
Bridge the gap between Java and Twain
 
Java Tip 132: The taming of the thread
Java Tip 132: The taming of the thread
 
roots of constants classes
roots of constants classes
 
From Writing Programs to Creating Compilers
From Writing Programs to Creating Compilers In this article we build a simple compiler that augments Java with tasks (independent blocks of code that execute in parallel), thus creating a new language called AJ that well supports the programming of syste
 
Creating EJB clients using the Eclipse Rich Client Platform
This article shows how to build a sample EJB client using the Eclipse Rich Client Platform (RCP), which has become increasingly popularity due to its extensible nature.
 
one-jar
One-JAR is a simple solution to a vexing problem in Java: how to distribute an application as a single jar-file, when it depends on multiple other jar-files. One-JAR uses a custom classloader to discover library jar files inside the main jar.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.