palindrome in java

Solutions on MaxInterview for palindrome in java by the best coders in the world

showing results for - "palindrome in java"
Henri
28 Feb 2019
1public static boolean checkPalindrome(String str)
2{     
3 
4    int len = str.length();
5
6    for(int i = 0; i < len / 2; i++)  {
7        if (str.charAt(i) != str.charAt(len - i - 1))
8            return false;
9    }
10    return true;
11}
Maimouna
22 Jun 2016
1import java.util.*;   
2class PalindromeExample2  
3{  
4   public static void main(String args[])  
5   {  
6      String original, reverse = ""; // Objects of String class  
7      Scanner in = new Scanner(System.in);   
8      System.out.println("Enter a string/number to check if it is a palindrome");  
9      original = in.nextLine();   
10      int length = original.length();   
11      for ( int i = length - 1; i >= 0; i-- )  
12         reverse = reverse + original.charAt(i);  
13      if (original.equals(reverse))  
14         System.out.println("Entered string/number is a palindrome.");  
15      else  
16         System.out.println("Entered string/number isn't a palindrome.");   
17   }  
18}  
Kathy
09 Mar 2017
1import java.util.Scanner;
2
3public class Palindrome
4{
5  public static void main(String args[])
6  {
7    int num,temp,reverse=0;
8    Scanner input=new Scanner(System.in);
9    num=in.nextInt();
10    temp=num;
11    //code to reverse the number
12    while(temp!=0)
13    {
14      int d=temp%10; //extracts digit at the end
15      reverse=reverse*10+d;
16      temp/=10; //removes the digit at the end
17    }
18    // 'reverse' has the reverse version of the actual input, so we check
19    if(reverse==num)
20    {
21      System.out.println("Number is palindrome");
22    }
23    else
24    {
25      System.out.println("Number is not palindrome");
26    }
27  }
28}
Bryn
31 Sep 2020
1package test
2//The function below checks if a string is a palindrome
3//True = Is a palindrome & False = Not a palindrome
4	public boolean isPalindromString(String text){
5    	String reverse = reverse(text);
6      	if(text.equals(reverse))
7    	{
8        	return true;
9      	}
10      
11      	return false;
12    }
13//This function returns the reverse String of its input.
14//Ex. if given "hello", it will return "olleh"
15	public String reverse(String input)
16    {     
17		if(input == null || input.isEmpty())
18        {
19			return input;
20        }
21return input.charAt(input.length()- 1) + reverse
22                         (input.substring(0, input.length() - 1));
23    }
Lela
14 May 2019
1public class PlaindromeTest1 {
2    public static void main(String[] args) {
3        Scanner input = new Scanner(System.in);
4System.out.println("Enter your words"); // Whats up body? // ?ydob pu stahW
5        String word = input.nextLine();
6
7        String reversedWord = "";
8        // start from last index number.
9        for(int i = word.length()-1; i>=0; i-- ){
10           reversedWord += word.charAt(i);
11        }
12        System.out.println(reversedWord);
13        //Level ==> leveL //ey edip adanada pide ye :)
14        boolean palindrome = word.equalsIgnoreCase(reversedWord);
15
16        System.out.println(palindrome);
17
18        String str = "Anna";
19        String result = "";
20
21        for(int i = str.length()-1; i>=0; i-- ){
22            result += str.substring(i, i+1);
23            // result += str.charAt(i); // char at de olur
24        }
25        boolean result1 = str.equalsIgnoreCase(result);
26        System.out.println(result1);
27    }
Angelina
17 Jan 2020
1package com.candidjava; import java.util.Scanner; public class PalindromeUptoN{	public static void main(String[] args)	{		int n, b, rev = 0;		Scanner sc = new Scanner(System.in);		System.out.println("Enter the Palindrome No N:");		int N = sc.nextInt();		System.out.print("Palindrome numbers from 1 to N:");		for (int i = 1; i <= N; i++)		{			n = i;			while (n > 0)			{				b = n % 10;				rev = rev * 10 + b;				n = n / 10;			}			if (rev == i)			{				System.out.print(i + " ");			}			rev = 0;		}	} }
queries leading to this page
program to print palinf 5cdrome in javapalindrome a string in javawrite a programme to check pallindrome of num javajava program to find whether a number is palindrome or notjava program to check whether a number is palindrome or notpalindrome string in java geeksforgeeksdefine palindrome in javastring special palindrome in java 8function palindrom javawrite a funnciton its take a string and return palindrom number in javawrite java program to check if a number is palindrome in java 3fjava check palindrome stringcreating a palindrome in javapalindromes from 1 to n in javaprogram to check palprime in javawrite a java program for palindrome numberpalindrome date program in javapalindrome java optimizepalindrome string program in javacalculate palindrome numbers in a range in javajava program to check whether string is palindromecheck if a number is palindrome javawrite a program to check whether a string is palindrome or not in javak palindrome program in javapalindrome in jvacheck if string is palindromic in javawrite a simple java program to check if a given string is palindrome or not using a boolean method to find a palindrome javacheck a string is a palindrome or not in javajava program to check palindromicity of a programprogram to check palindrome javacheck no is palindrome or not in javapalindrome program javacheck a string is palindrome or not in javafind count of palindromes in a string in javacheck no is a palindrome or not in javapalindrome string with remainder javais palindrome java in builtwrite a java program to accept a number and check if it is a palindrome how to find the largest palindrome in javapalindrome code in javapalindrome using java 8how to do palindrome in javasentence palindrome javajava program to check palindrome string in a efficient waypalindrome ll in javaprint palindrome or not in javapalindrome java codepalindromic checking in javahow to check palindrome number in java gfghow to check if a string contains a palindrome in javajava check if string is palindromecheck if a string is palindrome in javapalindrome lab javais palindrome program in javapalindrome string ajvapalindromic numbers range in javapalindrome program in java whether string or numberpalindrome integer javafind whether the given number is palindrome or not check if a sentence is palindrome javacheck number palindrome javahow to solve palindrome problem in java with 5 test casescheck if string is a palindrome javapalindrome in java time complexity string palindrome in javachecking palindrome using java 8palindromenumber program in javapalindromic score javapalindrome with javajava palindrome codejava number is palindromechange one character to get palindrome in javapalindrome number in java using string methodscheck palindrome of a number in javapolyndrom java code with scannerwrite a jaba program to check if a string is pallindormea palindrome is a number that reads the same java solutionjava program to check palindrome string using collectionchecking a palindrome string in javawrite a program to accept a number from the user through command line and display whether the given number is palindrome or not palindrome no in java gfgcheck for palindrome javachecking if integer is palindrome javafind the palindrome in a string javalongest palindrome in a string in javapalindrom program in javapalindrome string using arrats javapalindrome number in java from 1 to 1000write a simple palindrome program in javapalindrom using menthod javapalindrome series in javapalindrome of integer in javajava code for palindromenumber palindrome program in javapalindromo java codigopslindrome in javafinding palindrome in a string javapallindrome in javause stack to check palindrome javajava coding palindromewrite a program to check whether a number is palindrome or not in javawrite a java program palindrome or nothow to check palindrome string in javarange of palindrome in javajava program to find palindrome numberpalindrome string in javafunction to check given string string is palindrome or not in javapalingrome in javahow to find a string is palindrome or not in javapalindromic string in javawrite a function in java pallindrome stringhow to find number is palindrome in javajava code for palindromwrite a program to check whether a string is palindrome or not javapalindrome java methodalmost palindrome javahow to find palindrom in javajava palindrome interface examplechecking for palindrome in javajava program to check given number is pallindrome or notprogram related to palindrome in javapalindromchecker ispalindrome in javapalindrome no logic in javato check whether number is palandrome or not in javahow to find palindrome in javawap palindrome in javapalindrome string javawhat is the meaning of palindrome in javais palindrome possible program in java wipropalindrome noin javainteger palindrome check in javamatch two string for palindrome in javahow to check that wheater the word is pallindrome using javajava program for pallindromepalindrome simple program in javajava program find integer as palindromepalidrome in javacheck string is palindrome or not in javahow to palindrome a int in javapalindrone check string javalongest palindrome in javahow to generate palindrome numbers in javajava program to find whether the number is palindrome or notjava find palindrome in stringpalindrome in java string login example palidrim string in javafind given number palindrom or not javato check palindrome in javahow to traverse a palindrome javadetect palindrome in javachecking if an integer is a palindrome javahow to print a palindrome in javapalindrome or not in javajava program to find whether the given number is palindrome or nothow to print palindrome javareverse palindrome program in javaplaindrome javaarray palindrome javano of palindrome numbers in range in javapalindrome string in java with a fixed lengthpalindrome for phrase in javaprogram in java to check string is palindromepalindrome string algorithm javajava program to find the palindrome numbers in an arrayfind if given string is palindrome in javastring palindrome in java using functionstring palindrome program in java using for looppalindrome in java geeksforgeeksmake a palindrome in netbeanscheck if a number is palindrome in javapalindrome string in java programchecking palindrome in java wap in java to check whether a string is palindrome or not how to palindrone in javahow to check if something is a palindrome in javapallindrome program in javacheck palindrome in javacheck string palindrome in javapalindrome prime number in javapalindrome for integer in javafonction palindrome en javamake palindrom javajava program for palindromecheck palindrome string in javajava program for palindrome stringfunction to check string is palindome in javahot to code if a number is palindrome in javacheck string is palindrome or not javapalindrome java questions palindrome number in diamond in javapalindrome number in java using methodshow to check if a string is a palindrome in javahow to find next palindrome stringin javahow to check if a number is a palindrome in javapalindrome string complex java programchecking for palindrome array in javahow to count palindrome in javaword is palindrome in javastring is palindrome or not in javastring palindrome in java using arrayjava program to check palindromewrite a java program to check if an input number is a palindrome or not java check palindromepalindrom in javahow to see if a string is palindrome or not in java programsubstring palindrom javanumber is palindrome javajava palindrome number programwap to check whether a number is palindrome or not javaprogram to check palindrome in javapalindrome app in javahow to make user defined function for palindrome in javawhat is a palindrome number in javajava program to print all palindrome words in a stringjava palindromespalindrome range in javaprogram to find palindrome string in javapalindrome check in javacheck palindrome in java in range for nubmerpalindrome using string in javapalindrome for string in javanumber palindrome javahow to check if int is palindrome javapalindrom check javapalindrome in java intcheck if int is palindrome javajava check if palindromehow to check given number is palindrome or not in javajava palindrom easyint palindrome in javapalindrome printing in javacheck whether a number is palindrome or not in javapelindrom logic javastring palindrome in javajava code for integer palindromepalindrome code javapalindrome numbers in javapalindrome path in javapalindrome program in java using stringbuildera number is palindrome or not in javacheck for palindrome for integer in javapalindrome check javacheck for palindrome in javanumerical diamond palindrome program in javapalindrome java programssimplifystring palindrome javahow do you check if a given string is palindrome or not 3f by java 8how to code a palindrome in javajava code for finding a palindrome numberjava program to check whether string is palindrome using library methodspalindrome checker java with string functionswrite a program to enter a number and check whether it is palindrome number or not sub palindrome in javajava check if numbers are palindromejava program for palindrome or notcheck number is palindrome in javapalindrome using predicate in java 8java palindrom explainedhow to find whether a string is palindrome or not javapalindrome string java programhow to check if string is a palindrome in javapalindrome in java using stackwhat is a palindrome in javawrite a java program to check whether the given number is palindrome or notpalindrome number meaningcheck palindrome methodspalindrome no in javainteger palindrome in javapalindrom in a matrix javapalindrome in string javaimplement a palindrom checker in javapalindrome javapalindrome number or not in javajava palindrome numbers within a rangewrite a function in java pallindromepalindrom number in javapalindrome number java programpalindrome number ina range javapolyndrome in javajava palindromecode for palindrome string in javaflowchart to check if a number is palindrome or not in javaexplanation of solving palindrome javajava program to print palindromepalindrome java program stringjava palindrome using integerpalindrome in a string javafind all palindromes in a string javaperfect palindrome javawrite a program to check whether the given string is palindrome or not in javafind if a number is palindrome or not javaplaindrome with reverse java example wirh scannerpalindrome number using for loop in javapalindrome function with numbers in javais palindrome method in javapalindrome using for loop in javahow to get palindrome of a int in javacheck if palindrome javahow to code palindrome in java10 write a palindrome program in javaalogorithm in java to check whether a string is palindrome or notfind palindrome in string javawrite a program to check whether a given string is palindrome or not in javagenerate palindrome javapalindrome java codingfacehow to get palindrome of a number in javapalindrome in given range javapalindrome number in java using stackcreate palindrome javajava check if input is palindromepaindrome of numbers javacheck the string is palindrome or not in javapossible palindrome integer in java palindrome program in javafind out prime palindrome numbers javapalindromecheck in javalalindrome in javais palindrome in javaimplement a program to check whether a given number is a palindrome javacheck the given name is palindrome or not in javajava is palindromecheck whether string is palindrome or not in javacheck number is palindrome or not in javamake palindrome from string javapalindrome number in java using booleanpalindrome string javapalindrome checker in javajava program to find palindromelongest palindrome program in javahow to check palindrome number in javalongest palindrome in a string javafind palindrome string in javajava program to check if a number is palindrome or notpalindrome string in java usingn arraysmake palindrome javaprogram to check whether the number is palindrome or not in javajava palindrome stringjava program to find plaindromepalindromes javanumber palindrome in javajava code palindrome stringpalindrom program using javanumber is palidrome or nit in javaint palindrome in java using for looppalindrome number program in javais palindrome java while loopdetermine if a string is a palindrome javacheck if string of size n is palindrome javaprogram to find palindrome numbers between given range in javastring is palindrome on not in javanumber is palindrome or not in javahow to check the palindrome number in html using javapalindrome string with java 2fwrite a java program which read no from the user and check if this no is a palindrome or notpalindrome array in javabreak the palindrome in javapallindrome java codepalindrom java integerhow to check if a string is palindrome javapalindrome number checker javaanti palindrome string in javapalindrome strings in javajava program to0 find palindrome numberswrite a program in java to find the number is palindrome or notpalimdeome metod in javajava integer palindromepalindrom a string in javawhat is palindrome javanumber is palindrome or not javajava ispalindromeadd palindrome math javahow to do palindrome javapalindrome of number add them together javahighest value palindrome in javahow to check the palindrome number in html using javafxpallindorme javacode for palindrome in javajava palindromes for spaceswrite a java program to find whether a string or number is palindrome or notpalidrome check string in javapalindromenumber in javacheck if a number is a palindrome javajava polindromenumber palindrone or not javafind the palindrome of size k and length n in javaalgorithm for palindrome in javacode for string palindrome in javacheck if string is palindrome javacheck number palindrome program javapallindrome javajava palindrome solution charatpalindrome of number in javajava diff way to do pallidromepalindrome in java using for loopjava multithreading program to find palindromejava palindrome given a string s is palindrome or notjava program forpalindromepalidrome javawrite a complete java program that will determine if a given number is a palindrome print palindrome in javamake palindrome method in javajava for palindromefinding palindromes javapalindrome gfg javapalindrome number in jaapalindrome string in javathe palindrome game java solutionadvanced palindrome string question in jvacheck for palindrome algorithm javajava program palindromejava check plaindromepalindrome sort javaispalindrome for a number in javapalidrome string in javawrite a function to find out longest palindrome in a given string in javapalindrome in javapalindrome solution javacheck palindrome using stack in javapalindrome java programpalindromic prime number javapalindrome java palindeom code in javapalindrome no program in javapalindrome numnber in javanumber palindromehow to check if number is palindrome in javacreate function palindrome number in javapalindrom permutation javagiven string is palindrome number or not in javaispalindrome javapalindrome dll javajava program for palindrome number 10thhow to find anti palindrome in javaalgorithm for palindrome number in javapalindrome using stack javado palindrome string in javapalindromic numbers in jvastring palindrome in java codehow to compare palindrome in javapalindrome number in java using while loopjava string palindrome programpalindrome program using while in javajava ispalindrome codepalindrom programmieren javahow to check if palindrome javauser input palindrome in javapalindrome in java rangejava print a palindromepalindrome in javaajava program for palindrome numbernumber is a palindrome or not javapalindrome in javapalindrome word in javahow do you check if a given string is a palindrome in java 3fpalindrome using stack in javapalindromos en java check whether a string array is palindrome or not in javapalindrome integer in javacheck palindrome number in javawhat is palindrome number in javapalindrome questions javapallindrome number in javapalindrome number in java geeksforgeeks 5cjava program to check number is palindrome or notpalindrome words javachcek whether a number is a palindrome or not in javapalindrome number program javapalindrome or not javastring in java palindrome how to find palindrome javapalindrome check from reverse 28 29 in javajava program makes palindromejava method to check if a string is a palindromepalindrome code substring javapalindrome number using array in javapalindrome in java 8largest palindrome in string javapalindromes using javapolyndrom java codepalindrome program in java using for loopjava palindromicpalindrome function in javajava program to check whether a number is palindrome or not using functioncode to return a palindrome string in javamake a palindrom out of 4 number javapalindromeclass javalogest palindrome in javajava palindrome numberpalindrome of string in javapalindrome words java programpalindrome method in java stringpalindromic numbers in javajava palindrome algorithmpalindrome between range javacheck word is palindrome program in javafind palindrome number in javapalindrom number in javajava palindrome programpalindrome of a number in javapalindrome java numberpalindrome in java middle elementtest cases for palindrome number javapalindrome number in java geeksforgeekswhat is palindrome numberis palindrome java testpalindrome algorithm javapalindrome java intthe java code given below should find whether the number is a palindrome or not string palindrome code in javapalindrome in java programpalindrome method in code in javawrite a java program to find whether a string is palindrome or notpalindrome ajvapalindrome numberjava check palindrome numberif statement to check a string palindrome in javanumber is palidrome in java examplepalindrome examples in javafind all palindrome numbers between two numbers in javajava palyndromestring palindrome program in javacheck if number is a palindrome javapalindromic pattern in javajava can be palindromepalindrome alphabet program in javareturns true if string is a palindrome javaa java palindrome programhow to find palindrome number in javais palindrome javacheck if number is palindrome or not in javahow to find a palindrome number in javanumber is a palindrome javapalindrome test javajava program to check the string is palindrome or notwrite java program to check if a number is palindromepalindrome number in javahowto check if a string is a palindrome in javapalindrom in java programmierenjava is palindrome methodcommand line program to check if a number is palindrome or not in javapalindrome math java palindrome in java using booleanpalindrome or not javais string a palindrome javapalindrome number checking methods in javapalindrome jacapalindrome java programeis palindrome string javastring palindrome javajava program to read user input of a palindromehow to check palindrome of number using library function in javajava palindrome with looppalindrome method palindrome java stackjava palindrome number checkerhow to check if number is a palindrome javapalindrome program in javachecking palindrome string in javapalindrome method javapalindrome of number in java programpalindrom javapaliindrime in javais palindrome number possible program in javacheck palindrome javahow to do a palindrome in javachecking a palindrome in javapal c3 adndromo java palindrome formula in javajava collections pallindromecheck if number is palindrome javapalindromes examples java examplehow to check if a number is palindrome javahow to initialize n for palindrome in javapalindrome number javastring palindrome in java 8what is palindrome in javafind given integer palindrom or not javacheck if array is palindrome javapalindromic dates program javabeeter algorithme to check palindrome javafunzione palindroma javapalindrome finder function javalongest possible palindrome in javarearrange numbers to form palindrome if possible in javapalindrome of a string in javahow to find the palindrome number in javalongest palindrome javajava swing program to check string is palindrome or noteasy palindrome program in javapalindrome java questionhow to check if a string is palindrome in javalongest palindrome in string javapalindrome string function in javapalindrome number in java 3a palindrome numbers javacreate palindrome of size n in javato print all palindrome number in javajava program makes palindrome numberalindrom in javapalindrome in java stringpalindrome number code in javajava check if number is palindromehow to find next palindrome number in javapalindrome string using arrays javaidentify palindrome in javajava get total palindrome in stringhow to check palindrome array in java palindrome in javagiven a line print only those words which are palindrome in javaprint first n palindrome numbers in javastring palindrome in java using for loopwrite a code to check a if string is palindrome java codepalindrome checker javapalindrome logic in javaispalindrome java codepalindrome string complex java program using user inpujava polindrome interfaceinteger palindrome program in javapalindrome number using stack in javawrite a palindrome program in javapalindrome numbers in given range in javaphrase palindrome in javapalindrome number check in javahow to check palindrome nuber javachecking if a number is a palindrome javaprogram to check palindrome number in javaif number is palindrome javapalindrome substring in javawrite a java program to find whether entered number is palindrome or notis palidrome in javacheck if a string is palindrome javapalindrome numbers between the given range of numbers in javapalindromecutting 28s 29 in javahow to find a palindrome in javajava rmi palindrome programcode that reads a palindrome in javafind method in array of palindrome in javahow to find a palindrom in ajava stringcheck integer palindrome javajava number palindromeplaindrome a string in javapalindrome number in java from 1 to 100 palindrome character wrapper class in java examplejava generate palindromepalindrome in java