Actually, the point of passing something in a parameter is so that the class itself doesn't have to define and initialize the array, usually. Usually the main method is where you define it all and...
Type: Posts; User: javapenguin
Actually, the point of passing something in a parameter is so that the class itself doesn't have to define and initialize the array, usually. Usually the main method is where you define it all and...
Not necessarily always. What the compiler didn't like was calling a non-static method in a static way.
For instance
System.out.prinltn() calls the static variable out of the System class which...
private double fedTax = 0.17;
private double provTax = 0.14;
private double grossPays [];
private double empTaxes[];
private double proTax[];
private double feTax[];
private double...
double getGross ()
{
for (int g = 0; g< grossPays.length; g++)
{
return grossPays[g];
}
}
This is not a good idea. This will return grossPays[0] then exit the method.
Also, your array grossPay should be changed to
private double[] grossPay I think.
Set them to zero if numbers or null if Objects and then reset them to the values read in later.
Also, you're problem also wasn't initializing. Your methods you cal with the class name have to be...