Question 1 of 5
A factory models one work shift.
public class Shift
{
private int hours;
public Shift(int hours)
{
this.hours = hours;
}
public int getHours()
{
return hours;
}
public static int overtime()
{
return hours - 40;
}
}
(a) Explain why overtime does not compile. (b) Rewrite overtime so it takes one Shift parameter and uses getHours. (c) Explain why that rewritten class method may call getHours.