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.