Y**G 发帖数: 1089 | 1 Should java.lang not depend on anything else? Why Iterator not in java.lang
package?
package java.lang;
import java.util.Iterator;
/**
* Implementing this interface allows an object to be the target of
* the "foreach" statement.
*
* @param the type of elements returned by the iterator
*
* @since 1.5
*/
public interface Iterable {
/**
* Returns an iterator over a set of elements of type T.
*
* @return an Iterator.
*/
Iterator iterator();
} |
g*****g 发帖数: 34805 | 2 Does it matter? As long as it's part of JDK, it will load.
lang
【在 Y**G 的大作中提到】 : Should java.lang not depend on anything else? Why Iterator not in java.lang : package? : package java.lang; : import java.util.Iterator; : /** : * Implementing this interface allows an object to be the target of : * the "foreach" statement. : * : * @param the type of elements returned by the iterator : *
|
Y**G 发帖数: 1089 | 3 It does not matter if you just want to use JDK.
We are trying to hack JDK to come up with some striped down version, as long
as our small app can run on top of it, we want to cut unnecessary classes(
even for those classes in JDK) as much as possible to make our runtime as
small as possible.
【在 g*****g 的大作中提到】 : Does it matter? As long as it's part of JDK, it will load. : : lang
|
g*****g 发帖数: 34805 | 4 JDK isn't written with that in mind. And the value is little in today's
world.
long
【在 Y**G 的大作中提到】 : It does not matter if you just want to use JDK. : We are trying to hack JDK to come up with some striped down version, as long : as our small app can run on top of it, we want to cut unnecessary classes( : even for those classes in JDK) as much as possible to make our runtime as : small as possible.
|