Write the code for Palindrome ?

Answer Posted / aslam

public boolean isPaliandrome(String txtToCheck){

StringBuffer strb1 = new StringBuffer(txtToCheck).reverse();
if(txtToCheck.equals(strb1.toString()))
return true;
return false;

}

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by local class?

519


How will you reverse a link list without using recursion?

601


Explain about fail safe iterators in java?

570


Can we create our own wrapper class in java?

548


How to sort array of 0 and 1 in java?

545






Why we do exception handling in java and how many types of exceptions are there?

551


How many tetrahedral voids are there in bcc?

549


What do you mean by composition in java?

572


What is an immutable class? How to create an immutable class?

542


Can we rethrow the same exception from catch handler?

569


Why java is said to be pass-by-value ?

553


What is the java reflection api? Why it’s so important to have?

565


Explain about oops concepts.

638


What is the use of list in java?

527


What is jar?

637