Java - "int" and "long"
Hi. I created this program: public class MainClass { public static final int anzahl1 = 100; public static int[][] feld = new int[anzahl1][anzahl1]; public static int[][] wert2 (int y, int x) { return feld; } public static int wert(int y, int x) { if ((x==0 ) || (y<=x)) { feld[y][x]=1; return feld [y][x]; } feld[y][x]=feld[y-1][x-1] + feld[y-1][x]; return feld[y][x]; } public static void main(String[]args) { for (int y=1; y < anzahl1; y++) { for (int x =1; x <= y; x++) { System.out.print(wert (y, x) + " "); } System.out.println(); } } } but when i run it, i get negative numbers (cause theyre too big). which "int"s do i have to change to "long"s so it works?? thank you all :D