• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

void cannot be dereferenced problem  RSS feed

 
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!
 
Marshal
Posts: 4463
284
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.
 
Saloon Keeper
Posts: 9213
177
  • 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!