About Question enthuware.ocpjp.v8.2.1623 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
ramon.carrascom
Posts: 19
Joined: Sun Aug 27, 2017 12:35 pm
Contact:

About Question enthuware.ocpjp.v8.2.1623 :

Post 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!

admin
Site Admin
Posts: 10388
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.

ramon.carrascom
Posts: 19
Joined: Sun Aug 27, 2017 12:35 pm
Contact:

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

Post by ramon.carrascom »

Oh, I see! Thank you so much!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests