This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Int cannot be dereferenced Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Int cannot be dereferenced" Watch "Int cannot be dereferenced" New topic
Author

Int cannot be dereferenced

Mark Kaichou
Greenhorn

Joined: Feb 13, 2012
Posts: 2
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

Joined: Oct 02, 2003
Posts: 9948
    
    6

topTiming is declared as an int - a primitive type. Therefore, it doesn't have a length.


Never ascribe to malice that which can be adequately explained by stupidity.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 5873
    
    6



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

Joined: Feb 13, 2012
Posts: 2
Ahhhhh, I see, silly me, thanks for the prompt reply guys!
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 369

toptiming isn't an array ... you can't have length for primitive datatypes ...


http://plainoldjavaobject.blogspot.in
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Int cannot be dereferenced
 
Similar Threads
How close am I in getting this program right?
I need help refining some code
how do get particular date of total time
Calculating download time
Can't add to ArrayList within switch statement?