Lesson 14 of 34

Arrays: പല values ഒരുമിച്ച്

9 min 25 XP

Array ഒരേ type-ലുള്ള പല values ക്രമത്തിൽ സൂക്ഷിക്കുന്നു. Indexes 0-ൽ തുടങ്ങുന്നു, arr.length ഘടകങ്ങളുടെ എണ്ണം നൽകുന്നു. ഉണ്ടാക്കിയ ശേഷം array-യുടെ size മാറ്റാനാവില്ല.

Example: edit me and press Run

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

Input-ൽ നിന്ന് array നിറയ്ക്കാൻ: ആദ്യം എണ്ണം n വായിക്കൂ, new int[n] ഉണ്ടാക്കൂ, പിന്നെ loop-ൽ ഓരോ value-ഉം വായിക്കൂ. Coding tests-ൽ എപ്പോഴും ഈ format ആണ്.

Example: edit me and press Run

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

arr[arr.length] ArrayIndexOutOfBoundsException നൽകുന്നു. അവസാന index arr.length - 1 ആണ്.

Challenge

+25 XP

n-ഉം പിന്നെ n സംഖ്യകളും വായിക്കൂ. ഏറ്റവും വലുതും ചെറുതും print ചെയ്യൂ. Input: 5 3 8 1 9 4 Output: Max: 9 Min: 1

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