Enumerated types
-
Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:
Enum values are always integers.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
-
Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused:
nope ; internally,
enum
s are actuallyint
s
[VisualCalc][Flags Beginner's Guide] | [Forums Guidelines][My Best Advice]
-
Hey guys, I was wondering if u can have a user defined type such as: public enum Pizza { SMALL = 5.99, M = 7.99, L = 9.99 }; I am not quite sure if you can declare double variables inside the Pizza type? I believe someone can help :confused: