Mike. J. Thompson wrote:
Take a look at the lines in bold. If you call the linearSearch method twice it will run twice...
Paweł Baczyński wrote:Never write while(condition == true) or while (condition == false).
This is very error prone. You could easily write an assignment instead. Well... You did.
Always use while(condition) or while(!condition).
Carey Brown wrote:
Yes. Put it between lines 1 and 2.
Carey Brown wrote:
Sorry, my suggestion only works if you declare it just inside your class declaration, and not inside a method as you have it.
You should not compare strings using ==, use equals() instead.
The == only compares the references and not the value stored at the references. Two different string containing "joker" will not have the same reference.
Carey Brown wrote:You are searching 'args', not 'names'.
You should be declaring names as
This is assuming that NAMES will not be changing. This is how to declare constants, and constant names should be in all upper case.
Jason Bullers wrote:You can't access it because the system_task_objects is only in scope in your WorkOrders() method. As Campbell pointed out earlier, I think you intended that method to be a constructor. You should read up on how to declare those and how write a class correctly. That should help solve your current problem.
Also, as a side note: you should use camelCase for naming your variables (so systemTaskObjects and not system_task_objects).
Campbell Ritchie wrote:The type and location of that array keep changing.