• Post Reply Bookmark Topic Watch Topic
  • New Topic

Ran into int cannot be dereferenced  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i ran into int cannot be "dereferenced" when i tried to call scanner and fileread from another method.
so i could use the second method to read from a file and write it to an array...
I had the same issue with the first method as well, ended up making a new scanner and file read inside the Average method
This just doesn't seem right.



 
doug salls
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know i could just setup another filereader and scanner inside the second method to make that work.. but again..
Just doesn't seem to be the right way to go about it.....
 
Sheriff
Posts: 21137
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your ArrayFeeder method, the IntAssassin parameter is an int but you treat it as if it were a Scanner. Remember, that IntAssassin is not the same one as in your AVERAGE method.
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should seriously look into Java Naming Conventions. The identifiers you are using makes the code hard to read.
 
doug salls
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christiaan Lombard wrote:You should seriously look into Java Naming Conventions. The identifiers you are using makes the code hard to read.


Will work on that. Had been using it as way for me to get used to classes i am working with.
I'll take 3 seconds to Ctrl+R swap em before i post code again..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!