Content

1.Compile and run easy Java programs using JDK;
2.Edit, compile, run and debug in Eclipse.

Steps

Java in the terminal:

20145109 《Java实验报告1》

20145109 《Java实验报告1》

Running in the Idea:

20145109 《Java实验报告1》

Debug:

20145109 《Java实验报告1》

View variables at breakpoint:

20145109 《Java实验报告1》

Step into:

20145109 《Java实验报告1》

Step over:

20145109 《Java实验报告1》

Set breakpoint:

20145109 《Java实验报告1》

20145109 《Java实验报告1》

Problem & Solution

The demand is easy, while I had no idea about the way of encapsulation for the lack of experience. Our aim is to calculate all the prime from 1 to N, so it should be written as a method. So I new a class called 'Prime'. When I initialise the variable in the class, it turned out error. The assistant professor told me that all the operations should be written in Constructor or Method. Then I put the initialization in the Constructor. Problem solved!

step time percentage
demand analyse 0 0%
design 20min 30.76%
code 20min 30.76%
test 20min 30.76%
summarize 5min 7.69%

PS : code

相关文章:

  • 2021-08-03
  • 2021-08-03
  • 2021-12-27
  • 2021-11-09
  • 2021-08-04
  • 2022-12-23
  • 2021-12-05
  • 2021-08-17
猜你喜欢
  • 2022-12-23
  • 2021-10-09
  • 2021-12-09
  • 2021-05-17
相关资源
相似解决方案