The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.

Returning an array of indexes in my program.

I have a program that creates a double array for 50 states storing the last 10 tax rates for each year. The tax rate is less than .06 in all of them and is randomly configured to make the program run easier. This program is just to help me learn to access multidimensional arrays.

I need to create the following:
A method returning an array of indexes of the states that have had at least one year with a tax rate less than 0.001

I created a method that returns the max tax rate of all the states and years and also the least and returns the indexes.
However, I do not know how to return an array of indexes to satisfy this question.

Re: Returning an array of indexes in my program.

java.lang.NullPointerException
at SalesTax.get_less_tax(SalesTax.java:71)

There is a variable with a null value on line 71. Look at line 71 in the your source and see what variable is null. Then backtrack in the code to see why that variable does not have a valid value.
If you can not tell which variable it is, add a println just before line 71 and print out the values of all the variables on that line.