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