String[] strArray = new String[8] ; . . . . strArray[ strArray.length-1 ] = "the end" ;
String
to the Monitor
Here is a fragment that writes out the first two String
s to
the monitor:
System.out.println( "cell 0: " + strArray[0] ); System.out.println( "cell 1: " + strArray[1] );
Nothing unusual here.
Each array cell contains a String
reference that can be used
in the usual ways.
Here is a fragment that writes each cell's String
(if there is one)
to the monitor :
String[] strArray = new String[8] ; // combined statement . . . . . for (int j=0; j strArray.length; j++ ) { if ( strArray[j] != ) System.out.println( "cell " + j + ": " + strArray[j] ); else System.out.println( "cell " + j + ": " + "empty" ); }
Fill in the blanks.