Chapter 7 Flashcards
All the data that stored in __ must be of the same type
ARRAY
In java, an array is a special kind of ____ , but its more useful to think of it as a ____ of variables of the same type
object, collection
an array is consisting of a collection of seven variables of type double can be created as follows:
double[] temperature = new double[7];
Variables like temperature[0] and temperature[1] are called:
array elements
Note that the numbering starts at ___
0
True or False, Each of these seven variables can be used just like any other variable of type double
temperature[3] = 32; temperature[6] = temperature[3] + 5; System.out.println(temperature[6]);
You create an array in the same way that you would create an object of a class type using the operation new . When creating an array of elements of type Base, the syntax would be:
Base[] Array_Name = new Base[Length];
The following creates an array named pressure that is equivalent to 100 variables of type int:
int[] pressure = new int[100];
An array could be broken down into 2 steps:
int[] pressure;
pressure = new int[100];
True or false, this simple array pressure has length of 100, which means it has indexed variables pressure[0] to [99]
True
An array has only one public instance variable, namely the variable__
length
u can use the __ operator to give an array more than one name
assignment
______ allows you to define a very general class and then later define more specialized classes that add some new details to the existing general class definition.
Inheritance
True or False, A derived class is also called a subclass, a child class, and a descendant class
True
if the method in the derived class were to have the same name and the same return type but a different number of parameters or a parameter of a different type from the method in the base class, the method names would be _____.
overloaded