In my POJO, i usually declare the fields like this
class SampleModel {
var field1: String? = null
var field2: Int? = null
<more fields here>
}
If I declare like this, I will need to check if the field is null or not.
But if like this:
class SampleModel {
var field1 = ""
var field2 = 0
<more fields here>
}
I can use it directly.
Does it matter on which declaration to use? Like in terms of memory, performance, or anything that a good practice to do?
Lets say I have 100 fields. Then I use Moshi or Gson for the deserializer.