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 trialLawrence Babay
6,941 Pointsenum AttemptKind BREAK error
Hello,
I need help with AttemptKind class. I don't understand I keep getting an error on
BREAK(5 * 60);
it saying "Missing method body, or declare abstract"
package com.teamtreehouse.pomodoro.model;
public enum AttemptKind { FOCUS(25 * 60); BREAK(5 * 60);
private int mTotalSeconds;
AttemptKind(int totalSeconds) {
mTotalSeconds = totalSeconds;
}
public int getTotalSeconds() {
return mTotalSeconds;
}
}
3 Answers
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 PointsFOCUS(25 * 60)---> ; <----BREAK(5 * 60)
Just remove the semicolon [ ; ] between the Enum Constants and replace it with a comma [ , ].
Enum constants should be separated by commas i.e. [ EnumA, EnumB, EnumC, EnumD]
Thanks,
Jeff Wilton
16,646 PointsI don' t see an ending curly brace at the end of this line:
public enum AttemptKind { FOCUS(25 * 60); BREAK(5 * 60);
Lawrence Babay
6,941 PointsHi Jeff,
It actually has one. I just don't understand why I'm getting an red squiggly line under BREAK.