Arrays: Difference between revisions
Content added Content deleted
Line 4,657: | Line 4,657: | ||
Both which provide a substantial amount of implementing classes, for various types of dynamic array related tasks.<br /> |
Both which provide a substantial amount of implementing classes, for various types of dynamic array related tasks.<br /> |
||
The most logical, for this demonstration, would be the ''ArrayList'' and ''ArrayDeque''.<br /><br /> |
The most logical, for this demonstration, would be the ''ArrayList'' and ''ArrayDeque''.<br /><br /> |
||
The ''ArrayList'' declaration is slightly different than that of the array.<br /> |
The ''ArrayList'' declaration is slightly different than that of the array, as you are simply calling the constructor of a class.<br /> |
||
We'll use ''List'' as our declaring type, since, as with most interfaces, it's more logical to specify it as the declaring type during the instantiation of any implementing type.<br /> |
We'll use ''List'' as our declaring type, since, as with most interfaces, it's more logical to specify it as the declaring type during the instantiation of any implementing type.<br /> |
||
Immediately after the declaring type you'll use the 'diamond operators', < and >, with the data type of the array specified within. |
Immediately after the declaring type you'll use the 'diamond operators', < and >, with the data type of the array specified within. |