• Post Reply Bookmark Topic Watch Topic
  • New Topic

Not as much as a problem, but rather a question in the HeadFirst Midi player code  RSS feed

 
Pedro Fonseca
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, at first I typed everything just as in the book and...it didn't work, giving me a message that the Track symbol wasn't found.


But much to my surprise, giving the full address of the Track object suddenly made everything work just fine!



So I'm left wondering why in hell it didn't work previously, why didn't the import line work as intended? Is there any explanation at all?
 
Campbell Ritchie
Marshal
Posts: 56592
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got a Track class of your own?
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your original version compiles fine for me. Most likely you changed something else, or weren't compiling that original code that you posted here.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Have you got a Track class of your own?


That's what I thought too, but then it wouldn't give symbol not found for Track. I might complain about the method not being found, if his Track class doesn't have the same method.

Pedro Fonseca wrote:Ok, at first I typed everything just as in the book and...it didn't work, giving me a message that the Track symbol wasn't found.


@Pedro: Are you sure it was complaining that the class Track was not found? Not the method? Can you paste in the exact, complete error message?
 
Pedro Fonseca
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good catch, thanks for the replies.

Indeed the problem was another Track.class in the same folder as the MiniMiniMusicApp, I have to be more cautious about this sort of thing in the future.
 
Campbell Ritchie
Marshal
Posts: 56592
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pedro Fonseca wrote:Good catch, thanks for the replies. . . .
You’re welcome We have seen this sort of thing before.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!