Search:

Type: Posts; User: javapenguin

Search: Search took 0.09 seconds.

  1. Replies
    11
    Views
    2,271

    Re: Many questions

    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...
  2. Replies
    11
    Views
    2,271

    Re: Many questions

    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...
  3. Replies
    11
    Views
    2,271

    Re: Many questions

    private double fedTax = 0.17;
    private double provTax = 0.14;
    private double grossPays [];
    private double empTaxes[];
    private double proTax[];
    private double feTax[];
    private double...
  4. Replies
    11
    Views
    2,271

    Re: Many questions

    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.
  5. Replies
    11
    Views
    2,271

    Re: Many questions

    Also, your array grossPay should be changed to

    private double[] grossPay I think.
  6. Replies
    11
    Views
    2,271

    Re: Many questions

    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...
Results 1 to 6 of 6