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 trialDaniel Paradiso
Courses Plus Student 3,915 PointsMy intelliJ is telling me that the parameters passed into the Attempt constructor are backwards
I have : public Attempt(AttemptKind message, String kind) { mMessage = message; mKind = kind; mRemainingSeconds = kind.getTotalSeconds(); } with squiggly lines under the first two statements and getTotalSeconds is completely red. The errors for running are: Error:(9, 20) java: incompatible types: com.teamtreehouse.pomodoro.model.AttemptKind cannot be converted to java.lang.String Error:(10, 17) java: incompatible types: java.lang.String cannot be converted to com.teamtreehouse.pomodoro.model.AttemptKind Error:(11, 33) java: cannot find symbol symbol: method getTotalSeconds() location: variable kind of type java.lang.String These are the only errors.
1 Answer
Daniel Paradiso
Courses Plus Student 3,915 PointsRight, I followed the video. It shouldn't be any different than Craig's. I have flipped the things around, but then it changes the parameters everywhere else. I wanted to screenshot the code so people could see. Is there a way to do that and to post it?
Simon Coates
28,694 Pointsif you want to post code, use three backticks before and after the code (see the markdown cheatsheet). To post images, you can upload them to a hosting site and then include a link - markdown cheatsheet includes a syntax for that (i think, it's the link text in square brackets followed by the url in round brackets).
Simon Coates
28,694 PointsSimon Coates
28,694 PointsOn the first point, it may not be clear why that represents a problem, Unless there's a reason for the params to be in a specific order, people are going to be uncertain why you don't just change the order, or if you have access to the call to the constructor, feed the args into the call in a different order. The second error is similar to what i get when i intentionally call a method that doesn't exist. Someone debugging the code would probably want to see your version of Home.java and AttemptKind.java to make sure everything's consistent and then maybe move to more exotic options for what could be wrong.