import java.util.ArrayList;
public class List1 {
public static void main(String[] args) {
int ar[]={1,2,3,4};
ArrayList list=new ArrayList();
list.add(ar[0]);
list.add(ar[1]);
list.add(ar[2]);
list.add(ar[3]);
String a=new String();
for(int p:ar)
{
Integer x=new Integer(p);
a=a+new Integer(p).toString()+",";
}
System.out.println(a);
}
}
Output
1,2,3,4
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.