2 "A number is said to be palindrome il it appears to be the same after
reversing it's digits"". Write a program by using a class with the following
specifications:
class : Number
data members : private int num;
number (int x) : constructor to initialive num with x:
int reverse (int n): used to retum the reverse or number
void palindromeo: to check and print whether the number is palindrome
or not
pls help
will mark u brainliest whose with write answer
otherwise will ur answer if u spam
Attachments:
![](https://hi-static.z-dn.net/files/d41/0e640864f1b8c1ff56a58583594fd88e.jpg)
Answers
Answered by
0
public class Number {
private int num;
Number(int x) {
num = x;
}
int reverse(int n) {
return Integer.parseInt(new StringBuffer(n + "").reverse( ).toString( ));
}
void palindrome( ) {
System.out.printf("It is%sa Palindrome.", (num = = reverse(num)) ? " " : " not ");
}
}
Answered by
0
Answer:
please give me the program answer
Similar questions
Chemistry,
5 months ago
Math,
5 months ago
Math,
5 months ago
Political Science,
10 months ago
English,
10 months ago
Business Studies,
1 year ago