I have concern about what type of attribute best for use in Entity class. In my problem I have string attribute to persist.
I want to know what is best option to use from following ways and their pros and cons.
String[] attribute;
List<String> attribute;
Thank you
If you have one string to presist, use a basic String field. If you have a fixed number of strings use String[]. If you don't know how many strings you may have, use List<String>.
But, I think the List<String> is usually preferable over String[]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With