Created
April 4, 2014 15:14
-
-
Save jskDr/9976759 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
public class String2 | |
{ | |
public static void main(String[] args) | |
{ | |
String hw = "String of Hello world!"; | |
String hwAll[] = {"00", "11", "22"}; | |
String hwAll2[][] = {{"00", "zero"},{"11", "one"}, {"22", "two"}}; | |
System.out.println( hw); | |
// this is used for displaying one dimensional array | |
for(int i=0; i<hwAll.length; i++) | |
{ | |
System.out.println( hwAll[i]); | |
} | |
// it is for multidimensional method. | |
for(int i=0; i<hwAll2.length; i++) | |
{ | |
for( int j=0; j<hwAll2[i].length; j++) | |
{ | |
if( j == hwAll2[i].length - 1) | |
{ | |
System.out.print(hwAll2[i][j]); | |
System.out.println(""); | |
} | |
else | |
{ | |
System.out.print(hwAll2[i][j]); | |
System.out.print(" : "); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment