[Java in NetBeans] Lesson 07. JavaDoc and Unit Tests
阿新 • • 發佈:2018-12-14
這個課程的參考視訊和圖片來自youtube。
主要學到的知識點有:
1. organize code into packages
Create a package if want to make the jar file reusable for other projects too.
2. JavaDocs- document the code
In NetBeans Shortcut : /** == generate JavaDoc for method
/** * Print the message * @parammessage Message need to print */ public void printMessage(String message) { System.out.println(message); }
In NetBeans Shortcut : Ctl + Space == invodke JavaDoc for method
3. Test java methods with Junit
- Reduce the probability of semantic errors.
- Source Packages, right click, New, other, Unit Tests, Test for Existing Class.
- In NetBeans Shortcut : Ctl + F6 == Run Unit Tests.