Kontorotsui wrote:
> 
> Hello,
>         suppose I declare a class with a huge amout of instance variables and
> many, long, instance methods.
> 
> If I create thousands of objects of this class, of course there will be required
> thousands times the space of the variables, but what about the method code?
> I guess it's not repicated, but this up to the compiler.

It's not replicated. Objects in OO environments carry around tables that
help the runtime figure out which code needs to be called (as, for
example, when multiple versions of a method are defined in a class
hierarchy). The tables take some space, but the objects are certainly
not carrying around their own copies of the code.

Nathan

Reply via email to