Section 1: Declarations and Access Control (Chapter 4)
Study NotesArrays are objects. They contain a fixed number of elements of a specific type. The index of the first element is 0. The index of the last element is one less than the length of the array. Note how arrays are declared and constructed . Array size is not specified in the declaration, but is given when the array object is created. Multidimensional arrays are implemented as arrays of arrays. Modifiers affect classes, methods, and variables and each modifier has a specific significance. Accessibility modifiers specify where classes and methods can be accessed and used. Knowing which modifiers are applicable in a given context is important. Constructors are not normal methods. They must have the same name as the class. Constructors do not declare a return type, not even void . The implicit default constructor is employed when no constructors are specified. Calls to other constructors from within a constructor must be done as the first statement in the constructor body, using this() or super() . |