I'm programming in Java and I'm having trouble getting the following code to compile. The error (illegal start of expression) shows up at
private final int YA;
However, when I remove the private modifier on all the variables, it compiles fine.
I haven't been able to find a solution online, and most of my searches end up going toward questions about making constructors private (which I'm not trying to do). What really gets me is I've written another class that follows the same format, private final variables in the constructor, and it compiles without a problem.
I'm new to Java, so I could be missing something really boneheaded here. If so, please be gentle.
Cheers and thanks.
public class IndividualTaxCalculator {
IndividualTaxCalculator(int inYearAssessment) {
private final int YA;
YA = inYearAssessment;
switch (YA) {
case 2013:
private float netEmploymentIncome; // BTC cell H16
private float totalIncome; // BTC cell H27
private float assessableIncome; // BTC cell H31
private float chargeableIncome; // BTC cell H49
private float taxPayableOnChargeable; // BTC cell H51
private float incomeTaxRebate; // BTC cell H53
private float taxPayableAfterRebate; // BTC cell H55
private float parenthoodTaxRebate; // BTC cell H57
private float netTaxPayable; // BTC cell H59
break;
}
}
}