PalindromeStrings.java
package com.techbyteslearn.lab.basic; /** * This program illustrates how to find palindrome strings from an array. */ public class PalindromeStrings { public static void main(String[] args) { String[] stringArray = { "eye", "jdg", "javadevelopersguide", "aabaa", "hello", "pip" }; for (int i = 0; i < stringArray.length; i++) { printOnlyPalindrome(stringArray[i]); } } private static void printOnlyPalindrome(String str) { String oldString = str; StringBuilder builder = new StringBuilder(str); if (builder.reverse().toString().equals(oldString)) { System.out.println(oldString + " is a Palindrome String."); } } }Output:
eye is a Palindrome String. aabaa is a Palindrome String. pip is a Palindrome String.
Happy Learning.
Greetings! Very helpful article! I came across many new ideas through this article. Thanks for sharing! Java Training in Bangalore is the best place to learn Java and Advanced Java and give you more practical knowledge.
ReplyDeleteThanks For Sharing his nice post. Read Our Article in Fitness And Health Releted.
ReplyDeleteweb Development Company in Surat
Hi, Really Awesome post, Thanks for writing.
ReplyDeleteJava Training in Delhi
Thank for foe explaining palindrome program thanks for your efforts angular certification
ReplyDeleteAmazing blog thanks for sharing
ReplyDeleteangularjs online course
Angular Online Training
This is really a helpful blog I am really impressed with your work, keep it up the good work
ReplyDelete1Z0-819: Oracle Java SE 11 Developer
1Z0-900: Java EE 7 Application Developer
thanks for sharing a valid information a useful blog posting .
ReplyDeleteGerman Language Course In Chandigarh
Really awesome blog. Useful information and knowledge. Thanks for posting this blog. Keep sharing more blogs again soon.
ReplyDeleteUI Development Institute in Hyderabad
RPA Training Institute in Hyderabad
Python Training Institute in Hyderabad
Mean Development Training Institute in Hyderabad
thanks for sharing valid information and a blog post.
ReplyDeleteStudy In Germany
Thanks for sharing valuable post with us .
ReplyDeleteJava Training in Solapur
great blog, very informative, Java Classes In Amravati
ReplyDeleteGreat sharing!
ReplyDeleteThanks,
BroadMind - Best study in Germany consultants in Chennai
Embroidered QR Code Patch for Rick Roll Designs with Custom Stitching and Scannable Apparel Applications Online
ReplyDeleteExplore embroidered QR code patches featuring Rick Roll-inspired designs, custom stitching, and scannable patterns. Learn whether QR codes can be embroidered and discover techniques for stitching QR designs successfully. Create unique patches for shirts, jackets, hats, backpacks, and gifts with personalized artwork and interactive QR code functionality.