

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CS 110: Introduction to Computer Science Spring 2008
Java provides a few ways to represent lists, including the ‘array’ which his part of the Java language proper, and a number of classes in the Java library. Perhaps the easiest way to represent lists is with a library class called ArrayList. Take a look at the following Java and Python samples: Java: http://www.cs.usfca.edu/~wolber/courses/110.f07/javaSamples/ListTest.java Python: http://www.cs.usfca.edu/~wolber/courses/110.f07/javaSamples/ListTest.py Here's the key differences in terms of how you do things: Java ArrayList Python list ArrayList
Write a class Person and a main program that creates three person’s, puts them in a list, and totals up the age of each person in the list.
To practice using ArrayList and get started with the ParkingLot program, write the following code in the files Car.java and ParkingLot.java:
CS 110: Introduction to Computer Science Spring 2008