So made a simple program to solve it for me :)
BTW, I used java since I know it better than C++/C# and python...However I will train more in c++/c# and python when I have time :)
import java.util.ArrayList;
public class ArrayListArray {
public static void main(String[] args) {
ArrayList<Integer> al = new ArrayList<Integer>();
for(int j=0; j<=100; j++) {
al.add(j);
System.out.println("1-100: "+ al );
Object ia[] = al.toArray();
int sum = 0;
for(int i=0;i<ia.length;i++)
sum+=((Integer)ia[i]).intValue();
System.out.println("Sum av 1-100 :"+ sum);
}
}
}
Hope you guys can use it whenever you feel like it :)


Sign In
Create Account



Back to top









