|
A good answer might be:String[] strArray = new String[8] ; // combined statement . . . . strArray[ strArray.length-1 ] = "the end" ; | |
Writing a String to the MonitorHere is a fragment that writes out the first two Strings to the monitor: System.out.println( "Slot 0: " + strArray[0] ); System.out.println( "Slot 1: " + strArray[1] ); Nothing unusual here. Each array slot contains a String reference that can be used in the usual ways. Here is a fragment that writes each slot's String (if there is one) to the monitor :
| |
QUESTION 6:Fill in the blanks. Click Here after you have answered the question |