20182331 2019-2020-1 "Object-oriented programming and data structures" Experiment report

20182331 2019-2020-1 "Object-oriented programming and data structures" Experiment report

Course: "Programming and Data Structures"
Class: 1823
Name: High lenient
Student ID: 20182331
experiments Teacher: Johnny
experiment Date: September 9, 2019
Compulsory / Elective: Compulsory

1. Experimental content

基于命令行和IDE(Intellj IDEA 简易教程](http://www.cnblogs.com/rocedu/p/4421202.html)进行简单的Java程序编辑、编译、运行和调试。(本次实验主要使用命令行的方式)
练习Linux基本命令;
学习Java程序的JDB调试技能:https://www.cnblogs.com/rocedu/p/6371262.html
编写简单的Java程序。

2. Experimental procedure and results

在实验之前,我们需要在虚拟机上安装JDK程序才能进行编程,在结对同伴董其鹏同学的指导下,我完成了这一步。
实验第一步,我们打开终端并开三个窗口,然后用vim建立一个.java的文件,并输入实验代码。
然后把其他两个窗口其中一个用来编译并运行,一个用来单步调试。
关于单步调试:先在第三个窗口打下这样一段javac -g -d bin src/(你的文件名).java ,然后用stop in/at +(你想要的断点位置)设置断点,之后可以用step或next进入下一步,用list或local查看,cont退出。
 最后,完成这些步骤后把代码上交即可。

3. Experimental problems encountered in the process and settlement process

  • Question 1: javac compiler can not find the file
  • Problem 1 Solution: When I create a vim xx instead of vim xx.java, re-edit.
  • Question 2: Compile error.
  • Problem 2 Solution: ";" not in English because I could not find the gap
  • ...

Other (perception, thinking, etc.)

If only a simple Java program, I feel, and the term of C is not much difference, at best, the names of some of the same nature as the two other levels of different possible because I can not find the problem temporarily, but because there is no editor but operates directly under the linux system becomes the more difficult.

Reference material

Guess you like

Origin www.cnblogs.com/gao-kuanrang/p/11519879.html