• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot Find Symbol

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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[] .
 
Arthur Blair
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ernest.

I fixed the problem my making the methods in Array2.java receive specific Wrapper class arrays instead of Object arrays.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic