Question 1 of 5
A blacksmith class tries to report heat from a class method.
public class Forge
{
private int coals;
public Forge(int coals)
{
this.coals = coals;
}
public int getCoals()
{
return coals;
}
public static int heat()
{
return coals * 2;
}
}
(a) Explain why heat does not compile. (b) Rewrite heat so it takes a Forge parameter and uses getCoals. (c) State the value of Forge.heat(new Forge(6)) after that rewrite.