[問題] OCJP考題 - ArrayList
Idenfity two benefits of using ArrayList over array in software development
A. reduces memory footprint
B. implements the Collection API
C. is multi-thread safe
D. dynamically resized based on the number of elements in the list
Answers: A, D
----------------------------------------------------------------------------
I don't undertstand that why ArrayList could reduce more memory footprint?
Could anyone give me a hand and provide some examples? Thank you.
I also posted this question on reddit(FYI):
https://goo.gl/uB1k1p
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 180.217.142.185
※ 文章網址: https://www.ptt.cc/bbs/java/M.1485946899.A.C8A.html
※ 編輯: uopsdod (180.217.142.185), 02/01/2017 19:01:57
推
02/01 22:53, , 1F
02/01 22:53, 1F
推
02/01 23:20, , 2F
02/01 23:20, 2F
→
02/01 23:21, , 3F
02/01 23:21, 3F
→
02/01 23:22, , 4F
02/01 23:22, 4F
推
02/02 10:28, , 5F
02/02 10:28, 5F
→
02/02 10:28, , 6F
02/02 10:28, 6F
→
02/02 10:28, , 7F
02/02 10:28, 7F
→
02/02 12:52, , 8F
02/02 12:52, 8F
→
02/02 21:08, , 9F
02/02 21:08, 9F
→
02/02 21:08, , 10F
02/02 21:08, 10F
→
02/02 21:09, , 11F
02/02 21:09, 11F
※ 編輯: uopsdod (1.200.209.30), 02/02/2017 21:24:51
※ 編輯: uopsdod (1.200.209.30), 02/02/2017 21:25:10
→
02/03 15:13, , 12F
02/03 15:13, 12F
→
02/03 15:38, , 13F
02/03 15:38, 13F
→
02/03 15:40, , 14F
02/03 15:40, 14F
→
02/03 15:41, , 15F
02/03 15:41, 15F
→
02/03 15:42, , 16F
02/03 15:42, 16F
→
02/03 15:43, , 17F
02/03 15:43, 17F
→
02/03 15:44, , 18F
02/03 15:44, 18F
→
02/03 15:45, , 19F
02/03 15:45, 19F
→
02/03 15:46, , 20F
02/03 15:46, 20F
→
02/03 15:46, , 21F
02/03 15:46, 21F
→
02/03 15:48, , 22F
02/03 15:48, 22F
→
02/03 15:52, , 23F
02/03 15:52, 23F
→
02/03 15:53, , 24F
02/03 15:53, 24F
→
02/03 15:55, , 25F
02/03 15:55, 25F
→
02/03 15:55, , 26F
02/03 15:55, 26F
→
02/03 16:15, , 27F
02/03 16:15, 27F
java 近期熱門文章
PTT數位生活區 即時熱門文章