Currently learning Java right now, seems like a more difficult version of Python. Right now, we are learning about classes, and how to transfer Variables between classes. The project is simple, we are given two classes that have to do with taxes, and one class is the main, and the other sets the variables. While not adjusting the main class, how would you go through and debug these classes?
Main Class:
public class TaxFormTest {
public static void main(String[] args)
{
TaxForm michiganStateTaxForm = new TaxForm();
michiganStateTaxForm.setTaxRate(.07);
System.out.println("Tax Form Rate: " + michiganStateTaxForm.getTaxRate());
michiganStateTaxForm.setTaxRate(.09);
System.out.println("Tax Form Rate: " + michiganStateTaxForm.getTaxRate());
}
}
Secondary Class:
public class TaxForm{
int taxRate;
int rate;
private double taxrate;
public void setTaxRate()
{
taxRate = rate;
}
public double getTaxRate()
{
return taxrate;
}
}
Thank you if you are able to assist me on this question.