Lesson 16 of 34

ArrayList: যে List বাড়ে

9 min 30 XP

Array-র size নির্দিষ্ট। কতগুলো item হবে জানা না থাকলে 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.