Skip to main content
  1. Posts/

【UoPeople】CS1102 Unit7: Arrays and ArrayLists(入学29週目)

·87 words·1 min
Uopeople
  1. CS1102 Unit7 Arrays and ArrayLists
  2. length は個数
  3. 新しいプログラミング言語を学ぶときの 3 つのポイント

CS1102 Unit7 Arrays and ArrayLists
#

久々の更新。
1 教科の履修なので今期はだいぶ楽です。テーマもあまり難しくなく、今回は Array と ArrayList について。
Java に関しては初心者なので使い方は分かりませんが、がんばります。
へーと思ったことをつらつら書きます。

length とは
#

“ The number of items in an array is called the length of the array.”
抜粋:: David J. Eck “Introduction to Programming Using Java, Version 8.1.3”。 Apple Books

python でも len() があるし、JS では Array.prototype.length があるしなんとなく使っていましたが、言われてみれば確かにと思いました。 length は長さですが、要素の個数ですね。
言葉遊びのようですが、長さなのに個数じゃん、とちょっと思いました。確かに count とか size じゃないですね。

base type
#

Array の各要素の型を英語で base type と呼ぶらしい。
そして、ある型の値を持つ Array を、 array of intsとか、array of Stringsと呼ぶそう。