文件名称:20111101205604
- 所属分类:
- JSP源码/Java
- 资源属性:
- [WORD]
- 上传时间:
- 2012-11-26
- 文件大小:
- 9kb
- 下载次数:
- 0次
- 提 供 者:
- z**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
2) 定义接口Printable, 其中包括一个方法printItMyWay(),这个方法没有形参,返回值为空。
3) 改写矩形类,使之实现Printable接口,用printItMyWay()方法将矩形的相关信息(长,宽,周长,面积)打印在屏幕上。
4) 改写正方形类,重载printItMyWay()方法,将正方形的边长、周长,面积打印在屏幕上。
5) 在Printable接口中增加一个新的printItMyWay(char)方法,这个方法有一个字符类型的形参,返回值为空。其功能是利用给出的字符打印,例如若给定的字符为#,一个长为5,宽为3的矩形的屏幕打印结果为:
#####
#####
#####
在矩形类和正方形类中实现该方法.
-2) define the interfaces Printable, including a method printItMyWay (), this method does not shape parameters, return value is null.
3) rewrite the rectangle class, so to achieve Printable interface, with printItMyWay () method will rectangle information (length, width, Zhou
Length, area) printed on the screen.
4) rewrite the square class, override printItMyWay () method, a square of side length, perimeter, area printed on the screen.
5) In the Printable interface adds a new printItMyWay (char) method, this method has a character type parameter, return
Return value is null. Its function is to print using the given character, for example, if a given character to#, a length of 5, 3 wide rectangular screen printing results
Results are:
#####
#####
#####
Rectangular square in the class and the class implements this method.
3) 改写矩形类,使之实现Printable接口,用printItMyWay()方法将矩形的相关信息(长,宽,周长,面积)打印在屏幕上。
4) 改写正方形类,重载printItMyWay()方法,将正方形的边长、周长,面积打印在屏幕上。
5) 在Printable接口中增加一个新的printItMyWay(char)方法,这个方法有一个字符类型的形参,返回值为空。其功能是利用给出的字符打印,例如若给定的字符为#,一个长为5,宽为3的矩形的屏幕打印结果为:
#####
#####
#####
在矩形类和正方形类中实现该方法.
-2) define the interfaces Printable, including a method printItMyWay (), this method does not shape parameters, return value is null.
3) rewrite the rectangle class, so to achieve Printable interface, with printItMyWay () method will rectangle information (length, width, Zhou
Length, area) printed on the screen.
4) rewrite the square class, override printItMyWay () method, a square of side length, perimeter, area printed on the screen.
5) In the Printable interface adds a new printItMyWay (char) method, this method has a character type parameter, return
Return value is null. Its function is to print using the given character, for example, if a given character to#, a length of 5, 3 wide rectangular screen printing results
Results are:
#####
#####
#####
Rectangular square in the class and the class implements this method.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
20111101205604.doc