你这里有一个错误:
public FooCorporation (int a, double b) { a= hoursWorked; b = basePay; }
尝试在构造函数中为变量赋值,如下所示:
public FooCorporation (int a, double b) { this.hoursWorked = a; this.basePay = b; }
你的构造函数分配回到了前面
public FooCorporation (int a, double b) { a= hoursWorked; b = basePay; }
应该
public FooCorporation (int a, double b) { hoursWorked = a; basePay = b; }