Java Reference
In-Depth Information
Figure 3.3. Popping a pizza box from the array
Figure 3.3 shows the effect of using pop on the array. The pizzas array no longer con-
tains the string " Spinach & Rocket ".
The push() method appends a new value to the end of the array. This is like Donatello
putting a new pizza box on top of the pile, as shown in Figure 3.4 . The method returns the
new length of the array:
pizzas.push("Pepperoni");
<< 3
Search WWH ::




Custom Search