文件名称:Exception
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:2.66kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
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
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.