[Java in NetBeans] Lesson 07. JavaDoc and Unit Tests

这个课程的参考视频和图片来自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
 *  @param message 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.

猜你喜欢

转载自www.cnblogs.com/Johnsonxiong/p/10117410.html
今日推荐