Java Reference
In-Depth Information
for(hexLetter = 'A'; hexLetter <= 'F'; hexLetter ++)
System.out.print(" " + hexLetter);
// Blank line to separate table head from data
System.out.println("\n");
// Loop 3
// While ASCII codes smaller than 0x80 display row head
// and leading spaces
// Loop 4 (nested in loop 3)
// Display row of ASCII codes for columns 0 to 0x0F.
// Add a new line at end of each row
while (ascCode < 0x80)
{
System.out.print(" " + row);
for (column = 0; column < 16; column ++)
{
System.out.print("
" + ascCode);
ascCode ++;
}
System.out.print("\n\n");
row ++;
}
}
}
Figure11-1 isascreensnapshotshowingtheresultofcompilingand
executing the AsciiTable program.
Figure 11-1 Screen Snapshot of the AsciiTable.java Program
 
Search WWH ::




Custom Search