Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Public Enums in Class

15 views
Skip to first unread message

Ivar

unread,
Aug 10, 2012, 6:14:54 AM8/10/12
to
Hi All

I've just been looking through an old project of mine and had the following
thought.
I have a class object with properties, methods etc
I have a Collection Object to which I add\Delete what ever my class objects
to
I notice in the class code there are public enums Which help a lot when
writing code to change properties etc
I was wondering, If I load 100 class objects to my collection do I have 100
public enums or just the one
I will put the enums in to the collection class
Just wanting to know if the app had to remember 100 enums or just the one

Ivar

Deanna Earley

unread,
Aug 10, 2012, 6:38:21 AM8/10/12
to
An Enum value is pretty much just a constant so doesn't actually use any
space.
Besides, only data (variables) is duplicated for each class instance.
The code and definition is shared.

--
Deanna Earley (dee.e...@icode.co.uk)
i-Catcher Development Team
http://www.icode.co.uk/icatcher/

iCode Systems

(Replies direct to my email address will be ignored. Please reply to the
group.)
0 new messages