https://kotlinlang.org logo
#getting-started
Title
# getting-started
c

chroza

03/12/2024, 4:42 PM
hey everyone! what do I do if I have a data class, there is a
@StringRes
there which is optional, and I want to give it a default value, and I'm not sure which value do I give it? I can't do just
" "
cause it's not
String
, I saw some people using the
app_name
, what is your approach?
y

Youssef Shoaib [MOD]

03/12/2024, 4:43 PM
Maybe make it nullable and have the default be
null
❤️ 2
c

chroza

03/12/2024, 4:44 PM
omg yes,
null
it is, thank you 😄
e

ephemient

03/12/2024, 4:45 PM
c

chroza

03/12/2024, 4:45 PM
it is Int yes! thank you