algs4 使用 DrJava 編寫 Hello World on Windows

前階段讀了 Yinwang 的博客, 對 Scheme and Lisp 產生了很大的興趣, 用 學生模式的  DrRacket IDE一步一步開始實現 How to Design Programs。java

想到以前擱淺的 用 Atom 學習 Algs4 刷 LeetCode 計劃, 索性 也用 對學生友好的 DrJava 從新開始。windows

參考 https://algs4.cs.princeton.edu/windows/app

 詳細描述了搭建 algs4 學生環境。ide

This document instructs you on how to set up our Java programming environment for your Windows computer.
It also provides a step-by-step guide for creating, compiling, and executing your first Java program using either DrJava or the Command Prompt.
All of the software used is freely available. These instructions apply to
32-bit and 64-bit Windows 8, Windows 7, Vista SP1, and XP SP3.
  • 0.   Install the Programming Environment

     下載地址: https://algs4.cs.princeton.edu/windows/algs4.exe學習

     產生以下圖日誌: 詳細 https://algs4.cs.princeton.edu/windows/log.txtui

         

       完成以後:this

          

     看到這個圖片,以後刪除 algs4.exe.spa

     

  • 1.   Create the Program in DrJava

   

/******************************************************************************
 *  Compilation:  javac HelloWorld.java
 *  Execution:    java HelloWorld
 *
 *  Prints "Hello, World". By tradition, this is everyone's first program.
 *
 *  % java HelloWorld
 *  Hello, World
 *
 *  These 17 lines of text are comments. They are not part of the program;
 *  they serve to remind us about its properties. The first two lines tell
 *  us what to type to compile and test the program. The next line describes
 *  the purpose of the program. The next few lines give a sample execution
 *  of the program and the resulting output. We will always include such 
 *  lines in our programs and encourage you to do the same.
 *
 ******************************************************************************/

public class HelloWorld {

    public static void main(String[] args) {
        // Prints "Hello, World" to the terminal window.
        System.out.println("Hello, World");
    }

}

 

 compile -> 報錯 -》 好吧 終結 日誌

相關文章
相關標籤/搜索