Discussion:
Public Enums in Class
(too old to reply)
Ivar
2012-08-10 10:14:54 UTC
Permalink
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
2012-08-10 10:38:21 UTC
Permalink
Post by Ivar
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
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 (***@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.)
Loading...