Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

Write a Java program to check whether the given number is a palindrome?

Palindrome numbers are numbers that read the same backward and forwards.

For example: 272, 515, 71417

Here is a Java program that checks whether the given number is palindrome or not.


import java.util.Scanner;
public class Reverse {
  public static void main(String[] args) {
    System.out.println("Enter a string you want to reverse:");
    Scanner sc = new Scanner(System.in);
    String str = sc.nextLine();
    String rev = "";
    for (int i = str.length() - 1; i >= 0; i--) {
      rev = rev + str.charAt(i);
    }

    System.out.println("Reversed String:");
    System.out.println(rev);
  }
}

Test Your Website on 3000+ Browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free