I'm used to using
if (thisString != null && thisString.length() > 0)
I'm getting back an empty array (from within a serialized object over Sockets), my question is this - how do I check for an empty array?
Example...
public static void main(
String[] args) {
String[][] x = new String[0][0];
if ( x == null ) {
System.out.println("x is null");
} else {
System.out.println(x[0]);
// Crash and burn - null pointer exception
}
}
Thanks in advance
Tom