Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

public class Main {
    static boolean isPalindrome(String text) {
        System.out.println("Original text = " + text);

        String reverse = new StringBuilder(text).reverse().toString();
        System.out.println("Reverse text  = " + reverse);
        return text.equalsIgnoreCase(reverse);
    }

    public static void main(String[] args) {
        String text = "Sator Arepo Tenet Opera Rotas";

        System.out.println("Is Palindrom: " + isPalindrome(text));
    }
}