Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKele Heart
1,039 Points./GoKart.java:18: error: int cannot be dereferenced Error ?
I'm following the java track and I was trying to increment a battery charge. and I don't have any idea what this error means
1 Answer
Rebecca Rich
Courses Plus Student 8,592 PointsUsually this will happen if you try to call a method on an int (which is a primitive type). So for example, something like this:
int count = 1;
String counterText = "count" + count.toString();
The .toString() method call directly on the integer would throw that error. If that does not help you find your problem or if you have additional questions / code snippets, let us know!
Kele Heart
1,039 PointsYes this was my problem thank you so much
Brendon Butler
4,254 PointsBrendon Butler
4,254 PointsCould you post your code?