3 ms·
The "base datatypes" have to be accessed somehow. If you have base-type Array you have to access its elements somehow. In C-type language you would access the
by galaxyLogic 6y ago
The "base datatypes" have to be accessed somehow. If you have base-type Array you have to access its elements somehow. In C-type language you would access the elements by calculating a memory-offset and reading that location in memory. The problem is that now your code depends on elements of Array being stored in memory in specific (relative) locations.
Whereas in an Object Oriented language you would access the elements by calling a method myArray.at(123). The benefit is you don't need to know how that data is stored or where.
In OOP the elements of an Array of course can be Arrays too, whose elements you can similarly only access via a method-call.