0

I am creating a function in my java class such as assignval(int i). in this function i need to create the dynamic variable such when int value is 1 .I should have

String []data_value1 =data1.split(",");

String []key_value1 =key1.split(",");
which i am reading from property file.
when int value is 2 
String []data_value2 =data2.split(",");

String []key_value1 =key1.split(",");

so on

how can i achieve this.

i tried the below code but it dint work:

String assignval(int i){

Sting [] data_val+" "+i=DATA+" "+i.split(,)

String[] key_values+" "+i = key+" "+i.split(",");

}

where DATA i am reading from a property file.

property file:
DATA1=abc,def,ghi

DATA2=jkl,mno,pqr

key1=name,date

key2=place,address
so on 
thanks in advance.
israel altar
  • 1,768
  • 1
  • 16
  • 24
  • I don't understand the question. Can you explain more clearly what you are trying to do? – BoffinBrain Jul 06 '15 at 15:09
  • possible duplicate of [How to use Java property files?](http://stackoverflow.com/questions/1318347/how-to-use-java-property-files) –  Jul 06 '15 at 15:12
  • Can you give some examples with expected output and so on. I don't understand your question as well. – user3437460 Jul 06 '15 at 15:32

0 Answers0