java - assign a enum variable -
i have problem code want assign simple enum variable , eclipse give me error "empty cannot resolved or not field"
here code have enum class seed below :
public enum seed { // save "seed.java" empty, cross, nought }
and have cell class inside want use seed class :
public class cell { // package access seed content; // content of cell (seed.empty, seed.cross, or seed.nought) int row, col; // row , column of cell /** constructor initialize cell specified row , col */ public cell(int row, int col) { this.row = row; this.col = col; clear(); // clear content } /** clear cell's content empty */ public void clear() { content = seed.empty;//**error** empty cannot resolved or not field } }
what's wrong ?
save project , build , error disappear
Comments
Post a Comment