The fault in the stars of Kotlin and Gson

Abhilash Das
AndroidPub

--

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")

--

--