Table Of Comparisons Between String, Array And ArrayList
From Huben's Wiki
(Created page with "{| border="1" |- !width="25%" | Question !width="25%" | String named s !width="25%" | array named a !width="25%" | ArrayList named l |- style="height:100px" | Declare a variable...") |
|||
Line 5: | Line 5: | ||
!width="25%" | array named a | !width="25%" | array named a | ||
!width="25%" | ArrayList named l | !width="25%" | ArrayList named l | ||
− | |- style="height: | + | |- style="height:60px" |
| Declare a variable of this type. | | Declare a variable of this type. | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| Is it an object? | | Is it an object? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| What is the literal initializer, if any? | | What is the literal initializer, if any? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| What types of elements can it contain? | | What types of elements can it contain? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| Find how many elements it has. | | Find how many elements it has. | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| How can you insert or delete elements? (There is a way.) | | How can you insert or delete elements? (There is a way.) | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| How do you obtain the i<sup>th</sup> element? | | How do you obtain the i<sup>th</sup> element? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| How do you change the i<sup>th</sup> element? | | How do you change the i<sup>th</sup> element? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| How can it change size? | | How can it change size? | ||
| | | | ||
| | | | ||
| | | | ||
− | |- style="height: | + | |- style="height:60px" |
| Can it work with for each loops? | | Can it work with for each loops? | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | |- style="height:60px" | ||
+ | | What does toString() [and thus System.out.print()] do? | ||
| | | | ||
| | | | ||
| | | | ||
|} | |} | ||
+ | |||
+ | |||
+ | What methods does ArrayList implement from List? | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | (end of methods) |