The JAVA sourcode examples.

In this topic, I have chosen to use a rather nonstandard method for making the source code files available to The Free World. Also to the non-free world, but that's another subject.
Normally, I would make a download webpage, but that would result in you clicking a link and then getting a screen full of text. So I opt this time for giving you the text right away.
By default, you get the text on screen (Mr Sulu). If you want to save it, use the cut & paste method that applies to your operating system, or (Netscape and Mozilla users) use 'Shift' 'Left Mouse Button' to immediately download the source file instead of displaying it's contents.

A note for the people who still use MS Windows.

Windows users should use the right mouse menu clicker button key or whatever it's called there, to download the java sourcecode files.

Be very careful, though. Your Master has decided to protect the world against itself, so Windows will help you in any way it can. It will mangle upper and lower case tokens. It will add file extensions without your permission. It will also hide these same extensions from you, in directory listings, just to make sure your brain doesn't burn too fast due to the amount of data presented to you.

In short:

For the rest: have fun. And if you are in a good mood, install a Knoppix Linux distribution. It is 99% of Windows, but without the bugs, the virusses and the hassle. And it's free.

Ellsworth.java

Below is the source code for the JAVA program Ellsworth.java which I wrote in anothe life and now forget about it altogether. Here it comes:

public class Ellsworth 
{
   public static void main(String[] arguments) 
     {
	String line1 = "The advancement of the arts, from year\n";
	String line2 = "to year, taxes our credulity, and seems\n";
	String line3 = "to presage the arrival of that period\n";
	String line4 = "when human improvement must end.";
	String quote = line1 + line2 + line3 + line4;
	String speaker = "Henry Ellsworth";
	String title = "U.S. Commissioner of Patents";
	String from = "1843 Annual Report of the Patent Office";
	System.out.println('\u0022' + quote + '\u0022');
	System.out.println("\t" + speaker);
	System.out.println("\t" + title);
	System.out.println("\t" + from);
     }
}

jan@Beryllium:~/develop/java$ javac Ellsworth.java
jan@Beryllium:~/develop/java$ java Ellsworth

"The advancement of the arts, from year
to year, taxes our credulity, and seems
to presage the arrival of that period
when human improvement must end."
        Henry Ellsworth
	U.S. Commissioner of Patents
	1843 Annual Report of the Patent Office
jan@Beryllium:~/develop/java$
   

HelloDan.java

class HelloDan
{
   public static void main (String[] arguments)
   {
     System.out.println ("What's the frequency, Kenneth?");
   }
}
   

Palindrome.java

Here's the source for Palindrome.java. Don't ask me what iot does and why not.

import java.awt.Graphics;
import java.awt.Font;
import java.awt.Color;

public class Palindrome extends java.applet.Applet
{
   Font f = new Font ("TimesRoman", Font.BOLD, 36);
   
   public void paint (Graphics screen)
   {
      screen.setFont (f);
      screen.setColor (Color.red);
      screen.drawString ("Go hang a salami, I'm a Lasagna hog!", 15, 40);
   }
}
   
It compiles. It does not run. It produces more lines of error codes than lines of source. Not very assuring. perhaps I should not have bought the Head First Java book.

Page created December 2004,

Page equipped with FroogleBuster technology