
9.10 Exercises,Problems,and Projects 635
EXERCISES,PROBLEMS, AND PROJECTS
ArrayList<Integer> a = new ArrayList<Integer>( );
a.add( 7 );
a.add( 4 );
a.add( 21 );
a.set( 1, 45 );
32. After the following code sequence is executed, what are the contents
and index of each element of a?
ArrayList<Integer> a = new ArrayList<Integer>( );
a.add( 7 );
a.add( 4 );
a.add( 21 );
a.add( 1, 45 );
9.10.3 Fill In the Code
For Questions 33 to 37, consider the following statement:
String [][]geo = {{”MD“, ”NY“, ”NJ“, ”MA“, ”ME“, ”CA“, ”MI“, ”OR“ },
{ ”Detroit“, ”Newark“, ”Boston“, ”Seattle“ }};
33. This code prints the element at row index 1 and column index 2 of
the two-dimensional ...