g*g
2 楼
I mean for ArrayList, for LinkedList, of course it's different.
I didn't see the source, but if you decompile it, I believe
you'll see something like that.
I didn't see the source, but if you decompile it, I believe
you'll see something like that.
c*t
6 楼
Yes.
1. int[] is only a single function call to set/retrieve a primary value.
2. List involves 2 (one to retrieve and one to get value from Integer
object. This is not counting the fact that List internally
may access an array itself using another function call. The list
algorithm may also be slower. There are maybe several logic checks as
well. In short, List has a lot more overhead costs.
When in doubt, read the source code :)
【在 G*********a 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: @@
: //bow
1. int[] is only a single function call to set/retrieve a primary value.
2. List
object. This is not counting the fact that List
may access an array itself using another function call. The list
algorithm may also be slower. There are maybe several logic checks as
well. In short, List
When in doubt, read the source code :)
【在 G*********a 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: @@
: //bow
G*a
7 楼
thanks! :)
//bow
【在 c*****t 的大作中提到】![](/moin_static193/solenoid/img/up.png)
: Yes.
: 1. int[] is only a single function call to set/retrieve a primary value.
: 2. List involves 2 (one to retrieve and one to get value from Integer
: object. This is not counting the fact that List internally
: may access an array itself using another function call. The list
: algorithm may also be slower. There are maybe several logic checks as
: well. In short, List has a lot more overhead costs.
: When in doubt, read the source code :)
//bow
【在 c*****t 的大作中提到】
![](/moin_static193/solenoid/img/up.png)
: Yes.
: 1. int[] is only a single function call to set/retrieve a primary value.
: 2. List
: object. This is not counting the fact that List
: may access an array itself using another function call. The list
: algorithm may also be slower. There are maybe several logic checks as
: well. In short, List
: When in doubt, read the source code :)
相关阅读
FrameWork of Thread application 1Re: How to make a JButton stay pressed? (solution?)Re: 关于APPLET的IO问题A printable version of Java Interview Questions.Re: strange exceptionA Swing Book!!!!!!!!!!!!!Re: system property in javaRe: DCOM, CORBA, JAVA/RMIimportant notice about the FTP ServerAnother nice EJB server(recommend ;-)J2EE good stuffs sharing FTP Server Setupa book ftp site.Java Question 151-199(end)Re: How to make a JButton stay pressed?Re: I have a GUI problemFTP stuffs uploaded to GERDO's serverRe: connection poolRe: weblogic,有网址吗?Re: hashtableRe: JDBC access Oracle?? & Connection Pooling