This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Peter Taucher wrote:Are you sure you're using the correct compiler (e.g. type in shell 'java -version')?
You mean javac -version, surely? Of course, if the java version is wrong, you will still get an error, albeit a different one.
Joined: Sep 01, 2006
ya its giving as jdk 1.3.1 ,
i have set my path to point 1.6 in system properties how command promt shows as jdk 1.3
My path setting -->as oracle is using 1.3 is it the reason it is showing as 1.3 ??
C:\jdk1.6\jre\bin\client;C:\jdk1.6\jre\bin\client;D:\app\ixi\product\11.1.0\db_1\bin;C:\orant920\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\MKSNT\bin;
Rob Prime wrote:I don't see why this method was added anyway. It's just shorthand for length() == 0. The only advantage is 4 characters less.
Only four characters, but for me it's more about having less cognitive overhead. This seems like a big readability ROI:Less syntactic noise and more expressive; I find isEmpty to be much clearer, and tells a better story when read out loud (my ultimate standard of readability). There's a reason every string utility package has isEmpty() and/or isBlank()...
And both ELs and non-Java JVM languages can call it with foo.empty which is cleaner still--without having to monkeypatch String.
Joined: Oct 13, 2005
Rob Prime wrote: . . . It's just shorthand for length() == 0. The only advantage is 4 characters less.
Strinjg is a "library class" and you usually put as many methods in a library class as possible, just in case somebody wants to use it.