Object Conversion Between Python and Scala
Learn what's going on under the hood.
Objects representation in object-oriented language
In object-oriented programming, custom objects are usually defined using class hierarchy—class, subclass, superclass, and so on. Although composite datatypes such as list
, array
, dictionary
or map
are available, it’s impossible to attach methods to them. To write better modular code, the primitive and composite datatypes are often wrapped into class
and methods defined in the classes are used to manipulate the data stored in the class. For example, we can represent a Review
class as follows:
Get hands-on with 1200+ tech skills courses.