The fault in the stars of Kotlin and Gson
Published in
4 min readDec 25, 2019
In Kotlin, similar to default values in functions, we can initialize the constructor parameters with some default values.
If the class is initialized with arguments passed, those arguments are used as parameters. However, if the class is initialized without passing argument(s), default arguments are used.
class A (p1:String,p2:String = "P2")