Topic: 麻烦大家,一个LIST的问题 |
Print this page |
1.麻烦大家,一个LIST的问题 | Copy to clipboard |
Posted by: lionnick Posted on: 2004-10-03 13:21 list.get()返回值是什么? 如果是arraylist.get(object),返回的是object的首地址吗? 怎样利用get()遍历LIST,然后再去调用object里的方法呢? |
2.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: aleel_008 Posted on: 2004-10-03 16:10 你好象在C吧!java没有首地址的概念 for(Object i:list){}j就可以遍历 |
3.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: zerol Posted on: 2004-10-03 19:32 In JDK1.4, we might use Iterator to iterate a list.
|
4.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: lionnick Posted on: 2004-10-03 22:22 { consider using code tag and "Disable Smileys" } 我是这样写的:
输出的是: Gerbil.Gerbil@126b249 Gerbil.Gerbil@182f0db Gerbil.Gerbil@192d342 Gerbil.Gerbil@6b97fd 这是怎么回事?我想调用hop(),输出gerbilnumber,该怎么做? |
5.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: why Posted on: 2004-10-03 23:37 for(int i=0; i<gl.size(); i++) { |
6.Re:麻烦大家,一个LIST的问题 [Re: why] | Copy to clipboard |
Posted by: lionnick Posted on: 2004-10-03 23:53 why wrote:for(int i=0; i<gl.size(); i++) { toString输出的那些字符是什么? |
7.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: why Posted on: 2004-10-03 23:59 lionnick wrote: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#toString() The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character '@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode()) |
8.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: lionnick Posted on: 2004-10-04 00:11 不愧是总斑竹,深夜还在论坛里. 小弟刚接触JAVA不久,问的问题十分粗浅,谢谢总斑竹孜孜不倦的指教! |
9.Re:麻烦大家,一个LIST的问题 [Re: lionnick] | Copy to clipboard |
Posted by: why Posted on: 2004-10-04 01:09 lionnick wrote: 人在枫葉国,现在是下午。 要敝人在北京时间下午四时出现反而不行。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |