Lesson 16 of 34

ArrayList: വളരുന്ന List

9 min 30 XP

Array-യുടെ size നിശ്ചിതമാണ്. എത്ര items ഉണ്ടാകുമെന്ന് അറിയില്ലെങ്കിൽ ArrayList ഉപയോഗിക്കൂ, അത് സ്വയം വളരും. < >-നുള്ളിൽ int-ന് പകരം Integer, double-ന് പകരം Double എഴുതൂ.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Array: arr.length (brackets ഇല്ല). String: s.length(). ArrayList: list.size(). Interview-ൽ ഈ മൂന്നും തമ്മിൽ മാറിപ്പോകരുത്!

Challenge

+30 XP

n-ഉം n സംഖ്യകളും വായിക്കൂ. ഇരട്ട സംഖ്യകൾ മാത്രം ArrayList-ൽ ഇട്ട് അത് print ചെയ്യൂ. Input: 6 1 4 7 10 12 3 Output: [4, 10, 12]

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.