about | help | code help+videos | done | prefs |
Given an array of ints, return the length of the array. Remember that, for arrays, length is a field (a public final int instance variable, which although publicly accessible is also read-only) not a method. This is unlike String objects, where length requires the parentheses. (There's a reason: Strings contain arrays of char primitives as immutable private instance variables, and to reduce storage space they don't have an extra field just for length. Instead, they use a method to return the length field value of the underlying array.)apcsaArraysFindLength([0]) → 1 apcsaArraysFindLength([3]) → 1 apcsaArraysFindLength([2, 4, 5]) → 3 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 100 Post-solution available
Copyright Nick Parlante 2017 - privacy