Question: Consider the following class definition. ` ` ` public class FishTank { private double numGallons; private boolean saltWater; public FishTank ( double gals, boolean sw

Consider the following class definition.
```
public class FishTank
{
private double numGallons;
private boolean saltWater;
public FishTank(double gals, boolean sw)
{
numGallons = gals;
saltWater = sw;
}
public double getNumGallons()
{
return numGallons;
}
public boolean isSaltWater()
{
if (saltWater)
{
return "Salt Water";
}
else
{
return "Fresh Water";
}
}
}
```
Which of the following best explains the reason why the class will not compile?
Consider the following class definition. ` ` `

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!