Last active
November 24, 2015 13:18
-
-
Save edinak1/d34aa175ba9ee6035aa9 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 masivDuos; | |
import java.util.Arrays; | |
public class PrintArray { | |
public static void main(String[] args) { | |
String[][]data={{}, | |
{"Oleg"}, | |
{"Inna","Smith","25"}, | |
{"Irina","Koval"}, | |
{"Oleg","Kotov","16"}, | |
null, | |
{}, | |
{"Oleg","Anton",null,"Anna","25"}}; | |
printArray(data); | |
} | |
static void printArray(String[][]data) | |
{ | |
if(data==null) | |
return; | |
for(int i=0;i<data.length;i++) | |
{ | |
if(data[i]==null || data[i].length==0) | |
continue; | |
for(int j=0; j<data[i].length;j++) | |
{ | |
if(data[i][j]==null || data[i].length==0) | |
continue; | |
System.out.println(data[i][j]); | |
if(j==data[i].length-1) | |
System.out.println(); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Правильнее элементы строки массива выводить в одну строку.