Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
由于它不是家庭作业,因此如何实施并不重要。
public static <ToStringable> boolean isPalindrome(ToStringable stringable) { String text = stringable.toString(); return text.equals(new StringBuilder(text).reverse().toString()); }
Since its not homework, it shouldn't matter how you implement it.
回文是一个向后读与向前读相同的序列,如“kayak”或 12321。
请参见此处:http ://en.wikipedia.org/wiki/Palindrome
编辑:stackoverflow 上也有很多关于回文的问题。浏览它们,如果您有更具体的问题,请回来:
https://stackoverflow.com/questions/tagged/palindrome
A palindrome is a sequence that reads the same backwards as forwards, like "kayak" or 12321.
See here: http://en.wikipedia.org/wiki/Palindrome
EDIT: there are also lots of questions about palindromes on stackoverflow already. Browse through them and come back if you have more specific questions:
回文是一个序列,颠倒序列会得到相同的序列。例如MAM
Palindrome is a sequence such that reversing the sequence gives you the same sequence. E.g. MAM
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
暂无简介
文章 0 评论 0
接受
发布评论
评论(3)
由于它不是家庭作业,因此如何实施并不重要。
Since its not homework, it shouldn't matter how you implement it.
回文是一个向后读与向前读相同的序列,如“kayak”或 12321。
请参见此处:http ://en.wikipedia.org/wiki/Palindrome
编辑:stackoverflow 上也有很多关于回文的问题。浏览它们,如果您有更具体的问题,请回来:
https://stackoverflow.com/questions/tagged/palindrome
A palindrome is a sequence that reads the same backwards as forwards, like "kayak" or 12321.
See here: http://en.wikipedia.org/wiki/Palindrome
EDIT: there are also lots of questions about palindromes on stackoverflow already. Browse through them and come back if you have more specific questions:
https://stackoverflow.com/questions/tagged/palindrome
回文是一个序列,颠倒序列会得到相同的序列。例如MAM
Palindrome is a sequence such that reversing the sequence gives you the same sequence. E.g. MAM