文件名称:Exception
介绍说明--下载内容均来自于网络,请自行研究使用
1. 编写一个程序,用于根据用户输入的命令行参数数量来计算长方形、正方形、三角形的面积。如果输入的参数为一个、二个、三个则它们应分别对应正方形、长方形、三角形,如果没有参数,则通过异常处理方法显示错误消息。
提示:定义一个抽象的父类,并提供一个抽象的方法area().
再派生出三个子类,重写area()方法,然后在main方法中编写测试逻辑。
- Write a program, according to user input for the command line parameters quantity to calculate rectangle, square, triangle area. If the input parameters for the one, two, three, they should corresponding to the square, rectangle, triangle, if no parameters, it is through the exception handling method shows error messages.
Tip: define an abstract of the father, and provide an abstract method area ().
Then three subclasses derived, rewrite area () method, and then in the main method to write test logic.
提示:定义一个抽象的父类,并提供一个抽象的方法area().
再派生出三个子类,重写area()方法,然后在main方法中编写测试逻辑。
- Write a program, according to user input for the command line parameters quantity to calculate rectangle, square, triangle area. If the input parameters for the one, two, three, they should corresponding to the square, rectangle, triangle, if no parameters, it is through the exception handling method shows error messages.
Tip: define an abstract of the father, and provide an abstract method area ().
Then three subclasses derived, rewrite area () method, and then in the main method to write test logic.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
异常处理.doc