Answers for "write a java program that takes in a number n and finds the smallest palindrome prime greater than or equal to n. this should be done by creating two methods, one to check if the number is prime and one to check if the number is a palindrome."

1

integer palindrome in java

public boolean isPalindrome(int x) {
        String str = Integer.toString(x);
        String reverse =  new StringBuilder(str).reverse().toString();
        return  str.equals(reverse)?true:false;}
Posted by: Guest on April-26-2021
0

integer palindrome in java

public boolean isPalindrome(int x) {
        String str = Integer.toString(x);
        String reverse =  new StringBuilder(str).reverse().toString();
        return  str.equals(reverse)?true:false;
     }
Posted by: Guest on April-26-2021

Code answers related to "write a java program that takes in a number n and finds the smallest palindrome prime greater than or equal to n. this should be done by creating two methods, one to check if the number is prime and one to check if the number is a palindrome."

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language