We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Strings
- Java String Reverse
- Discussions
Java String Reverse
Java String Reverse
Sort by
recency
|
1912 Discussions
|
Please Login in order to post a comment
In java strings are considered as objects which makes them different than other primitive datatypes like int, float, etc. and we cant use "==" to compare 2 strings with each other thus we used str1.equals(str2) here for comparision of the strings
Easy and short way:
public static String palindrome(String A){ for(int i=0; i
Here is Java String Reverse solution - https://programmingoneonone.com/hackerrank-java-string-reverse-problem-solution.html
String A = sc.next(); char [ ] str = A.toCharArray();