| Author |
Cannot Find Symbol
|
Arthur Blair
Ranch Hand
Joined: Sep 20, 2005
Posts: 71
|
|
I have a "Cannot Find Symbol" compiler error that I am having difficulty resolving. The compiler says: In TestArrays2.java I have: In Arrays2.java I have: Can someone point me in the right direction? Thoughts appreciated.
|
 |
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 3011
|
|
Your Arrays2.fill method expects an Object array, two ints and a BooleanGenerator to be passed to it. You're only passing an array and BooleanGenerator. Also, if you're not using Java 1.5, you cannot pass an array of boolean primitives to a method that is expecting an array of Objects. I think autoboxing in java 1.5 will handle this.
|
Joanne
|
 |
Arthur Blair
Ranch Hand
Joined: Sep 20, 2005
Posts: 71
|
|
Thanks for the reply, J. Sorry, I forgot to include in my previous code listing. Array2.java includes this method which calls the overloaded fill() method. ...I'm using Java 1.5.0_03. So I should be able to pass a boolean array to this fill method right?
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24061
|
|
|
No, a boolean array is not an Object array, and won't be autoboxed. You'd have to pass an array of java.lang.Boolean, or implement another version that accepted a boolean[] .
|
[Jess in Action][AskingGoodQuestions]
|
 |
Arthur Blair
Ranch Hand
Joined: Sep 20, 2005
Posts: 71
|
|
Thanks Ernest. I fixed the problem my making the methods in Array2.java receive specific Wrapper class arrays instead of Object arrays.
|
 |
 |
|
|
subject: Cannot Find Symbol
|
|
|