Page 1 of 1

About Question enthuware.ocpjp.v8.2.1623 :

Posted: Mon Dec 10, 2018 2:30 pm
by ramon.carrascom
Could you please tell me how can you define a String array in a properties file?

I understand that with a file:

key1 = Test

If you use rb.getString("key1"), you'll get "Test", but... how do you define an array, if anything that goes after the = goes to the same value? I've been searching the Internet, and I couldn't find a satisfactory answer - even in java doc!! :?

Thanks in advance!

Re: About Question enthuware.ocpjp.v8.2.1623 :

Posted: Mon Dec 10, 2018 9:54 pm
by admin
The existing implementation of ResourceBundle that loads from a property file doesn't have a way to return a String[] but you could create a ListResourceBundle and have a String[] array as a value for any key.

Re: About Question enthuware.ocpjp.v8.2.1623 :

Posted: Tue Dec 11, 2018 12:43 am
by ramon.carrascom
Oh, I see! Thank you so much!