Skip to main content

Posts

Showing posts with the label Java

How to write a palindrome program in java

The Below program will tell you the given number is palindrome or not. In generally most of the interviewers are asking this question during interview process and candidates struggling to answer this question. Please practice the below program, this will help you. I hope. package testing; import java.util.Scanner; /**  * Please find the Java program to check if given number is palindrome or not.  * If number and its reverse is equal then this is called palindrome  * This program can also be used to reverse a number in Java  */ public class Palindromeprogram {     public static void main(String args[]){               System.out.println("Please Enter a number : ");         int palindrome = new Scanner(System.in).nextInt();               if(isPalindrome(palindrome)){             System.out.println("Number : " + palindrome +...