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.