fisio
fisio

Reputation: 554

how to declare nullable list

i have to declare a class parameter of type nullable list(contaning String) with list default value= null

data class Riga(
var frase1 : List?<String>= null
)

this is raising:

Property getter or setter expected 

One type argument expected for interface List<out E>

Upvotes: 2

Views: 848

Answers (1)

wseme
wseme

Reputation: 835

var frase1 : List<String>? = null

Upvotes: 1

Related Questions