Last active
September 3, 2020 18:13
-
-
Save mrnirva/fac0005c6816ce3ddd3169448cb0c0f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package arrayssinifi; | |
public class ArraysSinifi { | |
public static void main(String[] args) { | |
int[][] dizim = new int[2][3]; | |
// İlk köşeli parantezin içi satır | |
// İkinci köşeli parantezin içi sütun | |
// Böylece kapasiyeyi belirliyoruz | |
dizim[0][0] = 1; | |
dizim[0][1] = 2; | |
dizim[0][2] = 3; | |
dizim[1][0] = 4; | |
dizim[1][1] = 5; | |
dizim[1][2] = 6; | |
// Diziyi bir tablo halinde yazdırmak | |
// Çok boyutlu olduğu için iki for kullanmak zorundayız | |
for(int i=0; i<dizim.length; i++){ | |
for(int j=0; j<dizim[i].length; j++){ | |
System.out.print(""+ dizim[i][j]); | |
} | |
System.out.println(""); | |
} | |
/* | |
Çıktı: | |
123 | |
456 | |
*/ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment