Original Post
I'm working on a program to see if a word is a palindrome or not for AP Computer Science. Now, here's how the program will work generally. So that's what it'll be doing. However, how do I append a char data type to a String object? I want to then just compare the strings to see if they are the same or not. Any help please? Thanks.
import java.util.Scanner;
public class Palindrome
{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter a potential palindrome: ");
String palin = scan.nextLine();
String result = "";
for (int count = palin.length()-1; count >= 0; count--)
{
//Need help here
//I want to append to the result String whichever char
//is at palin.charAt(count)
}
}
}