On Nov 19, 3:06 am, "Norman Ho" <[EMAIL PROTECTED]> wrote:
> Example 5.2 in Lab-1106 has the following codes for enum type:
>
> public class UsingTypeSaveEnum {
>
> // Note that FootballScore is now enum type
>
> public enum FootballScore {
>
> TOUCHDOWN(6), FIELDGOAL(3), TWOPOINTS(2), SAFETY(2),
>
> EXTRAPOINT(1);
>
> FootballScore(int value) {
>
> this.score = value;
>
> }
>
> private final int score;
>
> public int score() {
>
> return score;
>
> }
>
> }
>
> ...
>
> Does the line: public enum Football ... define an inner class with enum
> type? Or is it just defining an enum type called FootballScore?
I would say both as an enum type is of class Enum, and defines
effectively an enum type. Then inside of the enum type you may in turn
define inner classes as you want.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---