Hi all,
I am just working through all the methods for String in java.
I am on compareTo at the moment but have to say i dont really know what it does, i have a small working program here to test it:
package testing; import java.lang.String; public class testpage { public static void main(String[] args) { String myString = "abcdef"; String myStringTwo = "regkaneighuornag"; int myInt = myString.compareTo(myStringTwo); System.out.println(myInt); } }
And my result for myInt is: -17
But what does this -17 actually mean ? Thanks. All java docs say is ''Compares two strings lexicographically."
But i dont know what this is.