
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Java code new ArrayList<String> having errors while compiling....
Hi Friends ,
I have below code in tjavarow written and it throws error at new ArrayList which works fine in eclipse ...
my requirement is to create json structure with in java for each array element and put it in to an json array structure.
String str = input_row.Lang_Str;
String[] array = str.split("\"\"");
//String[] output = new String[array.length];
List<String> output = new ArrayList<String>();
for(int i=0; i<array.length; i++) {
String sqlString = "languageTypeCd:"+array[i]+",providerSpeaksInd:null";
output.add(sqlString);
}
String finalString = "";
for (String string : output) {
if(finalString.equals("")) {
finalString = finalString + string;
}
else {
finalString = finalString +","+ string;
}
}
System.out.println(finalString);
output_row.Len = input_row.Len;
output_row.Lang_Str = finalString;
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hey uzix thanks for the reply , this issue got resloved .
the import was available but some how it was not working ...
java.util.List<String> output = new java.util.ArrayList<String>(); in the code which worked fine for me 🙂 .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hello,
in tjavarow , you have declared the import ?
->tjavarow > advanced settings
import java.util.ArrayList;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hey uzix thanks for the reply , this issue got resloved .
the import was available but some how it was not working ...
java.util.List<String> output = new java.util.ArrayList<String>(); in the code which worked fine for me 🙂 .
