• Post Reply Bookmark Topic Watch Topic
  • New Topic

void cannot be dereferenced problem  RSS feed

 
Michael Portman
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys.

I'm creating a Session API and i'm trying to set some member vars. Code:



Constructor code:



I have a setter method which sets them. Code:



But when I come to compile it I get the following error:



Help much appreciated. Many thanks!
 
Tim Cooke
Marshal
Posts: 3963
234
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the return type of this?

"void" right? Which is Java's way of saying "nothing". So what do you expect to be able to do with it? Also nothing.

What are you expecting .toString() to be called on here?
 
Michael Portman
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Cooke wrote:What's the return type of this?

"void" right? Which is Java's way of saying "nothing". So what do you expect to be able to do with it? Also nothing.

What are you expecting .toString() to be called on here?


Any need for the funny attitude? It doesn't matter ive sorted it now.
 
Stephan van Hulst
Saloon Keeper
Posts: 7932
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're misinterpreting Tim. He asked you an honest question. Tone doesn't really translate well in textual form. Anyway, how did you solve your problem?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!