Step 3: Copy the Program

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.

Answer:

The clipboard is a section of the computer's main memory that is used to copy data between various application programs.

Step 3: Copy the Program

Step 3 is to copy the characters of the program from the Web browser's window into the clipboard. Later (in step 4) the characters will be copied from the clipboard into your editor. Step 3 involves some skills using Windows that you may not have used, yet. Here is the example program, again:

class HelloPlanets
{
  public static void main ( String[] args )
  {
    String[] planets = {"Mercury", "Venus",  "Earth",   "Mars", "Jupiter", 
                        "Saturn",  "Uranus", "Neptune", "Pluto"};
  
    for ( int j=0; j< planets.length; j++ )
    {
      System.out.println("Hello " + planets[j] +"!" );
    }
  }

}

First, the characters of the program must be "highlighted" by clicking the mouse on the first character, and dragging to the last character:

  1. In the browser window (this window), put the mouse pointer on the "c" of "class".
  2. Push down on the left mouse button. Without lifting up on the mouse button, drag down until the final "}" of the program is covered.
  3. Lift up on the mouse button.

Be careful not to click the mouse again in the window or you will cancel your selection. (But you can always do it again.) After you have done this, you should see something like the following:

The last part of Step 3 is to copy the selected text into the clipboard.

QUESTION 8:

Look at the top menu bar of your browser window. There are a list of menus, such as "File", "Edit", "View", "Go", and others. Which one (do you imagine) will be used to copy to the clipboard?