Created
January 14, 2016 16:06
-
-
Save Yur-ok/43a6b38a29132cda77ca to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Lesson3.KeyPoint5; | |
import java.util.Arrays; | |
/** | |
* Created by Юрий on 14.01.2016. | |
*/ | |
public class PrintArrayVoid { | |
public static void main(String[] args) { | |
String[][] nul = new String[2][]; | |
String[][] a = {{"Oleg"}, {"Inna", "Smith", "25"}, {"Irina", "Koval"}}; | |
String[][] b = {null, {"Oleg", "Kotov", "16"}}; | |
String[][] c = {{"Oleg"}, {"Anton"}, null, {"Anna", "25"}}; | |
// System.out.println(nul.length); | |
printArray(nul); | |
printArray(a); | |
printArray(b); | |
printArray(c); | |
} | |
static void printArray(String[][] data) { | |
if (data != null) { | |
for (int i = 0; i <= data.length - 1; i++) { | |
if (data[i] != null) { | |
for (int j = 0; data[i] != null && j <= data[i].length - 1; j++) { | |
System.out.print(data[i][j] + " "); | |
} | |
System.out.println(); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment