tailieunhanh - murachs Java SE 2010 phần 5

Trang bên phải cho ảnh chụp màn hình, mã số, cú pháp, gạch đầu dòng chi tiết bất cứ điều gì là cần thiết để minh họa và tóm tắt các chủ đề, các trang còn lại cung cấp thêm lời giải thích và quan điểm khi cần thiết. Điều đó làm cho nó dễ dàng cho các nhà phát triển ở cấp độ nào | Chapter 9 Other object-oriented programming skills 317 5. Open the LineltemApp class that s stored in the chO9 LineItem dừectory and add import statements to import the three packages you just created. Then compile and run this class to make sure the application is working correctly. When you re sure it is close the class. 6. Open the LineltemApp class that s stored in the chO9 LineItemTester directory and try to compile this class. You should get several compile-time errors. That s because the LineltemApp class can t find the three packages even though it includes the proper import statements. 7. Use a command window to create a JAR file named that contains all three packages as shown in figure 9-3. Then move the file to the jre lib ext subdữectory of your JDK directory. 8. Try to compile the LineltemApp class that s stored in the LineltemTester dữectory again. This time it should compile. Then run this class to make sure it works correctly. Exercise 9-2 Document the murach packages This exercise guides you through the process of adding javadoc comments to the Product and Lineitem classes and using the javadoc tool to generate the API documentation for all the murach packages. 1. Open the Product and Lineitem classes that are stored in the chO9 LineItem murach business dữectory. 2. Add javadoc comments like the ones shown in figure 9-4 for the Lineitem class and its constructors and methods. Then compile the class. 3. Add javadoc comments like the ones shown in figure 9-5 for the Product class and its constructor and methods. Then compile the class. 4. Open a command window and use the javadoc command to generate the documentation for the and classes as shown in figure 9-6. When you re done this documentation should be stored in the ch09 LineItem docs dữectory. 5. Start your web browser navigate to the ch09 LineItem docs dữectory and open the page. 6. Click on the Validator class