Computer Science, asked by anshika1307, 6 months ago

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:

Answers

Answered by Oreki
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 ashithgowda2820
0

Answer:

please give me the program answer

Similar questions