由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Why java.lang.Iterable depends on java.util.Iterator
相关主题
Windows 下 Java console application 的问题interface和implementation class
Java代码,老是compile出错,大家帮我看看哪错了。。。Re: Java Tip: Constant
Simple question: delete element from collection on condition?JDK Source?
要随机返回一个Set的里的元素, 如何操作呢?Java 2D help..
问一道关于Vector的题请教一个MessageListener的问题
HashMap 怎样循环用更快?Java Interface
can applet implements runnable?java.security.KeyStore
问一个特别土的问题面试被问了个奇怪的GC问题
相关话题的讨论汇总
话题: iterator话题: why话题: jdk话题: elements话题: interface
进入Java版参与讨论
1 (共1页)
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.

1 (共1页)
进入Java版参与讨论
相关主题
面试被问了个奇怪的GC问题问一道关于Vector的题
How does a client find and connect to a specificHashMap 怎样循环用更快?
Re: Can create a Interface object, why?can applet implements runnable?
Re: connection pool问一个特别土的问题
Windows 下 Java console application 的问题interface和implementation class
Java代码,老是compile出错,大家帮我看看哪错了。。。Re: Java Tip: Constant
Simple question: delete element from collection on condition?JDK Source?
要随机返回一个Set的里的元素, 如何操作呢?Java 2D help..
相关话题的讨论汇总
话题: iterator话题: why话题: jdk话题: elements话题: interface