private String [][] personalDetails() {
logger.debug( "personalDetails()" );
String personArray [][] =
{
{ "John", " Muray", "1-10-1982" },
{ "Peter", " Kamau", "2-5-1987" },
{ "Mary", " Wambui", "8-5-1988" },
{ "Bethu", " Kips", "8-8-1987" },
{ "Cetera", " Omosh", "2-5-1987" }
};
return personArray;
}
/**
* Demonstrates initializing and populating a multi-dimensional array
* in one statement
*/
private void personalDetailsContent( ) {
logger.debug( "personalDetailsContent()" );
String [][] personArray= new String[ 5 ][5];
for(int i=0; i<=personArray.length; i++){
for(int j=0; j<=personArray[i].length; j++){
personArray[i][j]=i;
}
System.out.println( "Names " + i + "" + j +" : " + personArray[ i ][j] );
}
betny 0 Newbie Poster
NormR1 563 Posting Sage Team Colleague
betny 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.