5. What’s meaning of object keyword?
If you need to hold on to a single instance with state that is consistent throughout the
time that your program is running, consider defining a singleton.
According different usages, there are three ways to use the object keyword:
- object declarations(singleton design pattern)
- object expressions(anonymous implementation)
- companion objects(instance/factory design pattern)
14. Data Class
data classes are classes designed specifically for holding data, and they
come with some powerful data manipulation benefits
- toString()
- equals()
- copy()
- destructuring