AP Comp Sci Practice Exam Question

<p>7) Given two classes, Animal and Mammal, which of the following situations would make the statement valid?
Animal a = new Mammal("Elephant");
A) Mammal extends Animal and Mammal has a constructor with one parameter of the String type.
B) Mammal extends Animal and Animal has a constructor with one parameter of the String type.
C) Animal has a method Mammal that takes one parameter of the String type.
D) Animal has a public data member String Mammal
E) None of the above</p>

<p>I think it is A or B.</p>

<p>just some advice for the ap comp sci test. the mult choice was a lil challenging, but the free response was REALLY easy. i dunno if it was just because i took it last year when it was the first time they were offering java, but i remember looking around the room w/ about 30 min left in the free response, and everyone was just kinda looking around, because we had all checked our work like 5 times over, and there was still so much time left over. i think the best thing you can do for this is just do lots of practice problems (and it seems like you are doing that =)). AND KNOW THE CASE STUDY!!!</p>

<p>i think it is A cuz the constructor refers to the Mammal. Does anyone know of any good AP Comp Sci A websites or books. I need practice! thanks in advance.</p>

<p>it is A, because the mammal constructor is specifically being called. A class which extends another class can have additional constructors with different parameters [ as in some of the classes that extend Fish, in the case study.] </p>

<p>..the review book I've been using is "Be prepared for the AP Computer Science Exam in Java," Maria Litvin/ Skylit publishing. it's pretty good.</p>

<p>I'm using Barron's. It's basically a textbook + test prep in one.</p>

<p>when i took it i was given this book by my school: <a href="http://www.aw-bc.com/catalog/academic/product/0,1144,0201770814,00.html%5B/url%5D"&gt;http://www.aw-bc.com/catalog/academic/product/0,1144,0201770814,00.html&lt;/a&gt;&lt;/p>

<p>and i think it helped. also, my teacher had this book and it was pretty good: <a href="http://www.skylit.com/beprepapcsjava.html%5B/url%5D"&gt;http://www.skylit.com/beprepapcsjava.html&lt;/a&gt;&lt;/p>

<p>Ha, I also remember having a lot of time left over. But I also spent a lot of time erasing because I wrote too large on one section, and they really don't give you enough room to write the free-response on that exam.</p>

<p>I'm using Barron's and it includes Circular Linked Lists and Binary Expression Trees- Are those actually on the Comp Sci AB Exam? My teacher has never taught those but he says we're done learning all the topics. Thanks in advance.</p>

<p>You should definately learn both. </p>

<p>By the way, I also remember a lot of people in my class being surprised that iterators were on the exam.</p>