File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Cannot Find Symbol Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of RabbitMQ in Depth this week in the Open Source forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Cannot Find Symbol" Watch "Cannot Find Symbol" New topic

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 I have:

In I have:

Can someone point me in the right direction?

Thoughts appreciated.
Joanne Neal

Joined: Aug 05, 2005
Posts: 3742
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.

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. 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

Joined: Jul 08, 2003
Posts: 24189

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 receive specific Wrapper class arrays instead of Object arrays.
I agree. Here's the link:
subject: Cannot Find Symbol