当前位置: 代码迷 >> Java相关 >> [求助]
  详细解决方案

[求助]

热度:401   发布时间:2004-08-13 13:56:00.0
[求助]
getSize().height和getSize().width是哪个类中的
怎么有的程序没有声明就直接用了?

----------------解决方案--------------------------------------------------------

首先,我认为没有你所说的这两个methods但是,很难讲,因为我们并不知道这两个method是哪个class,最好的方法是去找JAVA API, 如果你所说的没有声明,就有这个method,那么我们一定可以在API里找到答案.谁能够记住API里的所有class所有 method? certainly not me!!!

有很多特例,for example, 在Point class, 坐标x和y 被JAVA默认为public,这是很少见的.

S Point p = new Point(3,4);

int i = p.x ; // this is NOT we usually can see, now i becomes 3.

// 所以x,y在Point class are defined as public

//similar stuff in Rectangle class as well


----------------解决方案--------------------------------------------------------
请问版主在什么地方能够下载java API函数库呢????谢谢!!
----------------解决方案--------------------------------------------------------
http://java.sun.com/j2se/1.4.2/docs/api/
----------------解决方案--------------------------------------------------------
  相关解决方案