O'Reilly logo

Java 2™ Programmer Exam Cram™ 2 (Exam CX-310-035) by Marcus Green, Bill Brogden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Exam Prep Practice Questions

Question 1 You are working on an aquarium-simulation class named Aquarius. You already have a method that adds a Fish object to the aquarium and returns the remaining fish capacity. This method has the following declaration:
public int addFish( Fish f )

Now you want to provide for adding a whole school of fish at once. The proposed method declaration is as follows:

protected boolean addFish( Fish[] f )

The idea is that it will return true if there is more room in the tank or false if the tank is too full. Which of the following statements about this proposal are true?

  • A. This technique is called overloading.

  • B. This technique is called overriding.

  • C. The compiler will reject the new method because the return type ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required