DEV Community

Discussion on: Meme Monday

Collapse
 
nlxdodge profile image
NLxDoDge

In java you can do something like this:

var shoppingList = new ArrayList<String>();
shoppingList.add("Milk");
System.out.println(shoppingList.get(0));
Enter fullscreen mode Exit fullscreen mode

That would print milk as far as I know. And if you pseudocode this up to other languages it will (for most) also work the same. It only depends if the implementation starts at 0 or 1.