• Post Reply Bookmark Topic Watch Topic
  • New Topic

Array help/ declaring the scanner console  RSS feed

 
Canh Ly
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, im needed help with a compile error I'm getting for my code. I am using a scanner to read a dat file I already made with values from -1.0 and 1.0, but the problem I am getting is where I declare (below) the file to the console. The error I am getting is saying that it can't find the symbol, for the variable sounds1. Wondering what I was doing wrong here? It is declared in my main so theoretically it should work, but I have looked in the books and it looks the same. I'll put the first skeleton code so you can better understand my thinking behind my work. Thanks guys! I know posting help for assignments is frowned upon, but I'm not asking for help writing my code or anything just help and a little guidance thanks!!





 
Canh Ly
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solved it!! Moved the File filein above the sounds1 and sounds 2 I put it in the wrong order so the doubles were trying to get info from nowhere. And When I was getting errors for sounds1 in the classes for printA and init A I didnt switch the sounds1.length to a.length so it was syntactically incorrect and wouldn't correct. Here is the new code that compiles.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!