登录
首页 » Java » Mypicture

Mypicture

于 2021-04-14 发布 文件大小:13KB
0 327
下载积分: 1 下载次数: 1

代码说明:

  定义4个类,MyShape、MyLine、MyRectangle和MyOval,其中MyShape是其他三个类的父类。MyShape为抽象类,包括图形位置的四个坐标;一个无参的构造方法,将所有的坐标设置为0;一个带参的构造函数,将所有的坐标设置为相应值;每个坐标的设置和读取方法;abstract void draw(Graphics g)方法。MyLine类负责画直线,实现父类的draw方法;MyRectangle负责画矩形,实现父类的draw方法;MyOval负责画椭圆,实现父类的draw方法。编写一个应用程序,使用上面定义的类,随机选取位置和形状,绘制20个图形。(Defines four classes, MyShape, MyLine, MyRectangle and MyOval, which MyShape the other three parent class. MyShape is an abstract class, including graphics position four coordinates a no-argument constructor, all the coordinates are set to 0 a parameterized constructor, all the coordinates is set to the corresponding values each coordinate set and reading method abstract void draw (Graphics g) method. MyLine class is responsible for drawing straight lines, to achieve the draw method of the parent class MyRectangle responsible for drawing rectangles, to achieve the parent class draw method MyOval responsible painted oval, draw method to achieve the parent class. Write an application that uses the class defined above, randomly selected location and shape, draw 20 graphics.)

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • Advanced-Topics-in-C
    Advanced Topics In C teaches concepts that any budding programmer should know. You ll delve into topics such as sorting, searching, merging, recursion, random numbers and simulation, among others. Increase the range of problems you can solve by manipulating versatile and popular data structures such as binary trees and hash tables.
    2013-12-09 23:11:13下载
    积分:1
  • C
    说明:  学习C基础入门很有帮助,全面讲解各块知识,值得一看(helpful for you to learn C well)
    2012-04-16 14:14:14下载
    积分:1
  • 12821599
    日期时间计算,判断日期时间合法性,转成统一格式,回车代替TAB键,等公共函数()
    2017-09-21 14:07:59下载
    积分:1
  • 获得系统的内存信息的小例子,我觉得不存,拿出来大家分享...
    获得系统的内存信息的小例子,我觉得不存,拿出来大家分享-Access to system memory information small example, I do not think we kept up to everyone to share
    2023-07-27 05:00:02下载
    积分:1
  • Simple Styles
    说明:  今天做的一个C#的小例子,希望初学者能够汲取精华,学习到更多的知识(A small example of C# today, I hope beginners can learn the essence and learn more knowledge.)
    2020-06-25 20:00:02下载
    积分:1
  • tutorial
    JAAS的简单应用示例,其中运行方式简单只需要拷贝到JAVA工程的src目录下就可以运行。本代码的编写依照JAAS的官方手册编写完成。(JAAS simple application example, which requires only a simple copy operation mode to the JAVA project s src directory, you can run.)
    2011-07-24 21:37:17下载
    积分:1
  • 我这次上传动态库的源码及设计文档,其实这网管序花了我不少精力,既有DBF文件读写,又有SNMP协议, UDP协议, TCP协议,ICMP协议, 算法等等, 有...
    我这次上传动态库的源码及设计文档,其实这网管程序花了我不少精力,既有DBF文件读写,又有SNMP协议, UDP协议, TCP协议,ICMP协议, 算法等等, 有的动态库是用VC编的-I upload this DLL source code and design documents, network management procedures fact that I spent a lot of energy on both DBF file read and write, there SNMP, UDP, TCP, ICMP, algorithms, etc., and some DLL is part of the VC
    2022-01-21 03:05:12下载
    积分:1
  • 卡尔曼鼠标跟踪
    说明:  用卡尔曼滤波器实现鼠标跟踪,用的python(Mouse tracking with Kalman filter)
    2020-07-01 16:40:02下载
    积分:1
  • Matlab的模拟退火算法工具箱
    Matlab的模拟退火算法工具箱,这是国外通用免费工具箱,在matlab环境下运行,具体使用说明见压缩文件(Simulating anneal arithmetic tool in Matlab is free fee abroad.It is used under Matlab and detail imformation can be found in rar file.)
    2005-06-01 16:56:03下载
    积分:1
  • nource
    易语言显示超大图源码,很不错的易语言源码,适合易语言爱好者学习,(Easy language display super large source code, very good easy language source code, suitable for easy language lovers to learn,)
    2018-07-31 20:04:08下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载