10. สิ่งผิดปกติ

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 10-19  การใช้ assert เพื่อตรวจสอบค่าตามที่คาดไว้
    ...
    int numberOfStudents = myClass.getNumberOfStudents();
    assert numberOfStudents > 0 : numberOfStudents;
    ...
©2009 S.Prasitjutrakul