Practice with Pre

Classic programmed-learning exercises, refreshed for modern Java and presented in the current MrStyner.com portfolio style.

Modern Java noteThis archive has been refreshed for Java 25 LTS. Core language concepts remain useful, while outdated setup instructions and browser-era Java are labeled or replaced. Java 26 is the current feature release; Java 25 is used here as the stable teaching baseline.
go to previous page   go to home page   go to next page        

Answer:

Poems, math formulae, columns of numbers, example program output. But sometimes it is better to use HTML tables for some of these. See this topic in a later section.

Practice with Pre

Here is a Web page with a program that should be pre-formatted:

See what happens to the poor program as it is. Then insert some <pre> ... </pre> tags so that it keeps its formatting, and click to see what the HTML does.

QUESTION 20:

It is often nice to indent preformatted text. The combination:

<blockquote><pre>

Indented, preformatted, text

</pre></blockquote>
Is useful for this. Use it with the above program to see its effect.