Re: java.lang vs java.util
On 04/02/2011 12:23 AM, Patricia Shanahan wrote:
On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote:
Surprising to see something defined in java.lang
<http://developer.android.com/reference/java/lang/Iterable.html> depend on
something defined in java.util
<http://developer.android.com/reference/java/util/Iterator.html>.
Surely the hierarchy should go the other way?
Not if it wants to be consistent with
http://download.oracle.com/javase/6/docs/api/
don't'cha think?
And the so-called "hierarchy" of java.util and java.lang is that they are
equal. The language reserves for itself the entire panoply of java.* and
javax.* packages.
I think Iterable may make it into java.lang because of its significance
in the foreach statement.
That seems to go against Java's history of conservatism with respect to
backward compatibility. And why should it? java.lang and java.util are
equal. The language reserves for itself the entire panoply of java.* and
javax.* packages.
--
Lew