java
所属分类:Windows编程
开发工具:Java
文件大小:7KB
下载次数:15
上传日期:2007-10-25 15:38:06
上 传 者:肖俊琴
说明: (1)设计一个程序,用于根据用户输入的命令行参数数量来计算长方形、正方形、三角形的面积。如果输入的参数为一个、二个、三个则它们应分别对应正方形、长方形、三角形,如果没有参数,则通过异常处理方法现实错误消息。(用于计算面积的方法是一个重载的方法。提示:定义一个抽象的父类,并提供一个抽象的方法area(). 再派生出三个子类,重写area()方法,然后在main方法中用多态来实现具体的面积函数的调用)。
((1) design a program for user input in accordance with the command-line parameters to calculate the number of rectangular, square, triangle area. If you enter the parameters for one, two, three, respectively, they should correspond to a square, rectangle, triangle, if there is no parameter by abnormal way to deal with the reality error message. (The method used to calculate the area is an overloaded method. NOTE: the definition of an abstract parent class, and provide an abstract method area (). Send another give birth to three sub-categories, rewriting area () method, and then in the main polymorphic methods used to achieve a specific area of function calls).)
文件列表:[举报垃圾]
java
....\2.doc
近期下载者:
相关文件:
收藏者: