zoukankan      html  css  js  c++  java
  • algs4 使用 DrJava 编写 Hello World on Windows

    前阶段读了 Yinwang 的博客, 对 Scheme and Lisp 产生了很大的兴趣, 用 学生模式的  DrRacket IDE一步一步开始实现 How to Design Programs。

    想到之前搁浅的 用 Atom 学习 Algs4 刷 LeetCode 计划, 索性 也用 对学生友好的 DrJava 重新开始。

    参考 https://algs4.cs.princeton.edu/windows/

     详细描述了搭建 algs4 学生环境。

    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.txt

             

           完成之后:

              

         看到这个图片,之后删除 algs4.exe.

         

    • 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 -> 报错 -》 好吧 终结 

  • 相关阅读:
    大话设计模式-原型模式
    Unity3D实习生面试题总结-图形学相关
    UnityShader入门精要-渲染流水线
    大话设计模式-工厂方法模式
    大话设计模式-代理模式
    C#中的值类型和引用类型
    【树结构】树链剖分简单分析
    HEOI2016排序-解题报告
    普通筛法时间界的证明
    可持久化线段树
  • 原文地址:https://www.cnblogs.com/heart-king/p/9151476.html
Copyright © 2011-2022 走看看