#agreed but now I know what to search for
1 messages · Page 1 of 1 (latest)
Object in memory is just an area of memory.
Anything can be written in there.
A type defines how that area is created, and how to interpret the data in it
If the data can't be interpreted by a type, its not valid for that type. It can be physically smaller, or contain wrong data, that cant be interpreted correctly.
When you have a type system, it puts constraints on what can be written into that area, and its size
And polymorphism in c# Apple is Fruit and so on, allows the type system to interpret same area of memory in different ways
okay..
Fruit has certain layout, some floats, strings
Apple will have same layout, PLUS some more
because the Apple can be safely reduced to Fruit, and read as a Fruit, it is a fruit