您的位置:首页 > 编程语言 > Java开发

20145109 《Java实验报告1》

2016-04-10 09:22 519 查看

Experiment Ⅰ ——getting familiar with JDK (Linux + Eclipse)

Content

1.Compile and run easy Java programs using JDK;

2.Edit, compile, run and debug in Eclipse.

Steps

Java in the terminal:





Running in the Idea:



Debug:



View variables at breakpoint:



Step into:



Step over:



Set breakpoint:





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!

steptimepercentage
demand analyse00%
design20min30.76%
code20min30.76%
test20min30.76%
summarize5min7.69%
PS : code
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: