This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Odd NullPointerExceptions  RSS feed

 
Tekaistu Tunnus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code in my program



The problem is that I get the NullPointerExceptions from the following lines:
this.taulukko[0] = myynti;
and
return ennustetaulukko;

The main-method is in another class that should be fine. I just don't have any clue why it gives those exceptions.

Edit: Oh, the forum messes up with italics because I had an array in my code that has index i... So I changed it.
[ May 29, 2006: Message edited by: Tekaistu Tunnus ]
 
Tekaistu Tunnus
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some italics made the post look silly. The another exception line should be:
this.taulukko[0] = myynti;
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be careful of shadowing.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!