 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check a string is palindrome or not in Jshell in Java 9?
JShell is the first REPL(Read-Evaluate-Print-Loop) interactive tool that has been introduced as a part of Java 9. It evaluates declarations, statements, and expressions as entered and immediately shows the results, and it runs from the command-line prompt.
Palindrome string is a string where it remains the same when reversed or word spelled the same way in both forward and backward directions.
In the below example, we can able to check whether the given string is palindrome or not in the JShell tool.
C:\Users\User>jshell | Welcome to JShell -- Version 9.0.4 | For an introduction type: /help intro jshell> String str="LEVEL"; str ==> "LEVEL" jshell> String revstring=""; revstring ==> "" jshell> { ...>       for(int i=str.length()-1; i>=0; --i) { ...>          revstring +=str.charAt(i); ...>       } ...>       System.out.println(revstring); ...>       if(revstring.equalsIgnoreCase(str)){ ...>          System.out.println("String is Palindrome"); ...>       } else { ...>          System.out.println("String is not Palindrome"); ...>       } ...>    } LEVEL String is Palindrome Advertisements
 