API的使用

chennut0802 2008-03-31 11:14:45
请问在api文档中类Enum没有values()这个方法,为什么在以下代码中却能调用它呢?
public enum Direction{L,LU,U,RU,R,RD,D,LD,STOP};
Direction[] dirs = Direction.values();
...全文
97 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
chennut0802 2008-04-05
  • 打赏
  • 举报
回复
大家好,我是新手,请问为什么我在api文档中找不到“java.lang.Object
extended by java.lang.Enum <ElementType>
extended by java.lang.annotation.ElementType”和
“All Implemented Interfaces:
Serializable, Comparable <ElementType> ”的信息?
hmsuccess 2008-04-01
  • 打赏
  • 举报
回复
同意楼上的
hmsuccess 2008-04-01
  • 打赏
  • 举报
回复
同意楼上的
chen09 2008-03-31
  • 打赏
  • 举报
回复
LZ可以看一下,java.lang.annotation.ElementType的javadoc
java.lang.annotation
Enum ElementType

java.lang.Object
extended by java.lang.Enum<ElementType>
extended by java.lang.annotation.ElementType

All Implemented Interfaces:
Serializable, Comparable<ElementType>

这个里面有:
static ElementType[] values()
Returns an array containing the constants of this enum type, in the order they are declared.

62,623

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧