Results 1 to 2 of 2

Thread: Write a program in JAVA to check given string is palindrome or not.

  1. #1
    JacksonPerez is offline Banned
    Join Date
    Dec 2009
    Posts
    274
    Rep Power
    0

    Default Write a program in JAVA to check given string is palindrome or not.

    Hi. I want to write program to check given string is palindrome or not. I am new in programming world. I am learning JAVA programming language. Any help would be highly appreciated. Thanks in advanced.

  2. #2
    ThompsonHarris is offline Senior Member
    Join Date
    Dec 2009
    Posts
    255
    Rep Power
    3

    Default

    The code that I have mentioned will definitely help you:

    Code:
    class palindrome 
    { 
    
    public static void main(String[] args) 
    { 
    String str = ""; // write a string name
    
    StringBuffer sb = new StringBuffer(str).reverse(); 
    
    String strRev = sb.toString(); 
    
    if(str.equalsIgnoreCase(strRev)) 
    { 
    System.out.println(" given string is Palindrome"); 
    } 
    else 
    { 
    System.out.println(" given string is Not a Palindrome"); 
    } 
    } 
    }

Similar Threads

  1. C# program for palindrome
    By Harvey Lavan in forum Programming
    Replies: 3
    Last Post: 01-10-2012, 11:00 AM
  2. Replies: 2
    Last Post: 05-14-2010, 01:30 PM
  3. write sequence data java program
    By Brownchris in forum Programming
    Replies: 1
    Last Post: 01-22-2010, 06:09 PM
  4. Write program on palindrome in java
    By MoralesMyers in forum Programming
    Replies: 2
    Last Post: 01-14-2010, 06:24 PM
  5. C# program for palindrome
    By JacksonPerez in forum Programming
    Replies: 0
    Last Post: 01-13-2010, 06:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48