Working on a problem to reverse a string and I am getting [C@659e0bfd when I try to use the following method to reverse a string. Anyone know what's wrong with this code?
public static String reverseString(String string) {
if ((string == null) || (string.length() <= 1)){
return string;
}
char[] charArray = string.toCharArray();
char[] newString = new char[charArray.length];
for (int i = 0; i < charArray.length; i++ ){
newString[i] = charArray[(charArray.length -1)-i];
}
return newString.toString();
}