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 trial

Java Build a JavaFX Application Build a Pomodoro App The Model

enum 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
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Tonnie Fanadez
UX Design Techdegree Graduate 22,796 Points

Hi Lawrence Babay

FOCUS(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
Jeff Wilton
16,646 Points

I don' t see an ending curly brace at the end of this line:

public enum AttemptKind { FOCUS(25 * 60); BREAK(5 * 60);

Hi Jeff,

It actually has one. I just don't understand why I'm getting an red squiggly line under BREAK.