Write Java program to check whether the word is palindrome or not.

class Palindrome
{
  public static void main(String args[])
  {
    String ow="MADAM";
    String rw="";
    int l=ow.length();
    for(int i=l-1;i>=0;i--)
      rw=rw+ow.charAt(i);
    if(ow.compareTo(rw)==0)
      System.out.print("Word is Palindrom");
    else
      System.out.print("Word is not Palindrom");
  }
}

Popular posts from this blog

Priority Scheduling Algorithm Java Program.

Implement UNIX system calls like ps, fork, join, exec family, and wait for process management (use shell script/ Java/ C programming).

Implement a class CppArray which is identical to a one-dimensional C++ array (i.e., the index set is a set of consecutive integers starting at 0) except for the following : 1. It performs range checking. 2.It allows one to be assigned to another array through the use of assignment operator. 3.It supports a function that returns the size of the array.