Which of the following can be used to replace public class Dog /* line 1 */ so that the loop in howMeanIsThe Pound would access all of the dogs in the ArrayList? //instance variables not shown public Dog ( int age ) 1/implementation not shown ) public double getHowMean() { // implementation not shown A. dogs d Dog B. Dog d: dogs C. Dog d = dogs D. int d : dogs E. int d = 0; d < dogs.size() > public class Dog Pound private ArrayList dogs; //other instance variables, //constructors, and methods not 8. Assuming /* line 1 */ is filled correctly. which of the following can be used to replace /* line 2 */ so that the loop in method howMeanIsThe Pound would sum up the mean of all dogs in the ArrayList? shown public double howMeanIsThe Pound) 1 int mean = 0.0; for /* line 1 */ > mean = mean + /* line 2 */ A. d.getHowMean(); B. get HowMean(); c. dogs.get HowMean(); D. dogs (i).get HowMean(); E. d.get (d); return mean;

Q&A Education