The test code is:
String s = "";
System.out.println(s.split("").length);
On Mac and Windows ,the output is 1, but when the string is not empty,like:
String s = "1";
System.out.println(s.split("").length);
On Mac, the result is still 1,while on Windows, the result has changed to 2. Both IDE is eclipse.Why does this occur? As Java's purpose is "Write once ,run anywhere".