Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: stack Palindrome , java

  1. #1
    Junior Member
    Join Date
    Dec 2010
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default stack Palindrome , java

    import java.util.*;
    public class CheckPalindrome{
    public static void main(String[]args){
    Scanner input=new Scanner(System.in);
    System.out.print("Enter String: ");
    String st=input.next();
    String str[]=st.split("");
    String reversedSt="";
    for(int i=str.length-1;i>=0;i--){
    reversedSt+=str[i];
    }
    if(st.equalsIgnoreCase(reversedSt)){
    System.out.println("String is palindrome");
    }
    else{
    System.out.println("String is not palindrome");
    }
    }
    }


    can any one rewrite this code using stacks java stacks?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: stack Palindrome , java

    can any one rewrite this code using stacks java stacks?
    I am sure there are those that could, but will anyone do this for you? Probably not (and if they did they would be violating the JPF forum guidelines). Someone can however help you if you show what you've tried in order to implement a Stack, where you are stuck, etc...

Similar Threads

  1. What am I doing wrong with this stack? Java Programming?
    By babe20042004 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: May 1st, 2011, 12:19 PM
  2. Palindrome
    By mag12203 in forum Algorithms & Recursion
    Replies: 13
    Last Post: December 20th, 2010, 08:28 PM
  3. Palindrome Stacks
    By mgutierrez19 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 7th, 2010, 03:05 AM
  4. Custom Java stack class (with generics) problem
    By TBBucs in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 7th, 2010, 02:25 AM
  5. Check for palindrome numbers
    By SnooSnoo in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 4th, 2010, 06:11 PM