• Call Us: +91 9437911966
  • Email Us: info@studentstutorial.com
  • Home
  • C Examples
  • Server Side
    • PHP
    • Java
    • CodeIgniter
    • Laravel
    • JSP
    • JDBC
  • Frontend
    • HTML
    • CSS
    • Javascript
    • jQuery
    • AJAX
    • FPDF
    • TCPDF
  • APP & DB
    • Android
    • Cordova
    • SQL
    • Oracle
  • Project
Java Introduction System.out.println(): Program for input through console Program for addition Program for Subtraction Program for Multiplication Program for Division Program for modulus Program for increment Program for percentage Program for square Program for cube Program for square root Check Even or Odd Reverse of a number Find prime numbers Find factorial Program for palindrome Program for Diamond Star Program for Pascal Star Program for Fibonacci Series Find largest number Find Smallest number Find largest third number Find largest second number Program for Bubble Sort Program for Insertion Sort Program for Selection Sort Program for Linear Search Program for Binary Search Find IP address Open notepad through java program Find Armstrong Number Find mirror clock Comparing Value create Backup file Program for file content modifier Program for copying files Fahrenheit to Celsius create deadlock program Implement hashcode program Convert File to Zip Remove Duplicate Element From Array Java Matrix Addition Java Matrix Multiplication

Java palindrome program (with a scanner class input from keyboard)

  • Students Tutorial
   

Hello world program

import java.util.Scanner; 
class Palindrome {   
 public static void main(String args[]) {   
  int rem,sum=0,rev;     
  int n=454;//It is the number variable to be checked for palindrome   
  
  rev=n;     
  while(n>0) {     
   rem=n%10;  //getting remainder   
   sum=(sum*10)+rem;     
   n=n/10;     
  }     
  if(rev==sum)     
   System.out.println("It is a palindrome number ");     
  else     
   System.out.println("It is not a palindrome number");     
}  
}  

Java palindrome program of a no (input through program)

import java.util.Scanner; 
class Palindrome {   
 public static void main(String args[]) {   
  int rem,sum=0,rev;     
  int n=454;//It is the number variable to be checked for palindrome   
  
  rev=n;     
  while(n>0) {     
   rem=n%10;  //getting remainder   
   sum=(sum*10)+rem;     
   n=n/10;     
  }     
  if(rev==sum)     
   System.out.println("It is a palindrome number ");     
  else     
   System.out.println("It is not a palindrome number");     
}  
}  

Output

palindrome
Student Tutorial is a online tutorial for web design and development. Here you can find easy example and explanation for each tutorial.
Copyright © 2016-2025 Student Tutorial

Server Side

  • PHP
  • Java
  • CodeIgniter
  • Laravel
  • JSP
  • JDBC

Frontend

  • HTML
  • CSS
  • Javascript
  • jQuery
  • AJAX
  • FPDF

App & Database

  • Android
  • Cordova
  • SQL
  • Oracle