• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Int cannot be dereferenced

 
Mark Kaichou
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been spending hours and hours trying to figure what have I done wrong to no avail, I've spent a load of time online trying to figure it out but I still can't!!!
Error's at line 154 :/

 
fred rosenberger
lowercase baba
Bartender
Posts: 12196
35
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
topTiming is declared as an int - a primitive type. Therefore, it doesn't have a length.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


What would you expect that to mean? Primitives (byte, char, short, int, long, float, double, boolean) are not objects and do not have member variables or methods. They're just simple values. So you cannot do somePrimitive.something.
 
Mark Kaichou
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhhhh, I see, silly me, thanks for the prompt reply guys!
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
toptiming isn't an array ... you can't have length for primitive datatypes ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic