In our modern day and age, with everyone using these nice Java editors, and high color monitors, some developers chose to use color to highlight different elements of the code. These range from simple keywords to elaborate parenthesis and quotes, and pieces of expressions. For example, take a look at OrgJosExampleJava. Here is the same file with the colors my editor assigns to it. --MichaelFried
<b>Proposed color scheme by BradNeuberg, Nov 30, 1997:</b> method names - <font color=blue>blue</font> ex. <font color=blue>public void printHelloWorld()</font> javadoc comments (author comments, version comments, class & method comments) - <font color=red>red</font> ex. <font color=red>/** This class prints Hello World * @author John Doe * @version 1.0 */</font> class name - <font color=green>green</font> ex. <font color=green>public class FirstProgram extends Applet</font>Feel free to add more or submit your own ideas. - BradNeuberg, Nov 30, 1997
<font color="#008800">/* * @(#)Example.java 1.1 1997.11.30 * * This software forms part of the distribution of the JOS * operating system (see http://www.jos.org/) and is * subject to the license conditions currently in force. * * Briefly, these will permit you to: * 1. Use the software without any (including implied) warranty, * 2. Redistribute the software with the same license, * 3. Modify the software including the existing author list, * 4. Sell the software with the same license. */</font> <font color="#008888">package</font> org.jos; <font color="#008800">/** * This class exists to give an example of good style for source code. * * @version 1.1 * @author Michael Fried * @author Tony Austin */</font> <font color="#008800">// Real tabs work in Wiki/html.</font> <font color="#008888">public class</font> Example { <font color="#008888">public static</font> main(<font color="#000088">String</font> args[]) { <font color="#000088">System</font>.out.println(<font color="#880000">"This is an example class."</font>); <font color="#008800">// Analogous to the "hello world" which we all wrote years ago</font> } <font color="#008888">public</font> Example() { } }
-- BradNeuberg