登录
首页 » Java » Mypicture

Mypicture

于 2021-04-14 发布 文件大小:13KB
0 353
下载积分: 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 个回复

  • 基于Qt的计算器
    说明:  1.支持常规四则表达式求值 2.支持热键唤醒 3.保持置顶 4.支持显示输入的历史记录,并拷贝复制(1. Support the evaluation of four regular expressions 2. Support hotkey wake-up 3. Keep top 4. Support the display of input history and copy)
    2020-04-22 16:31:35下载
    积分:1
  • Csharp专业项目实例开发配套源代码
    说明:  中国水利水电出版社出版的书籍《Csharp专业项目实例开发》配套的源代码 (China Water Conservancy and Hydropower published books "Csharp examples of professional development project" complementary source code)
    2005-09-09 23:22:28下载
    积分:1
  • 开源工具类库com.google.zxing
    使用开源工具类库com.google.zxing,实现二维码的编解码(Use of open-source tool library com.google.zxing, two-dimensional code codec)
    2012-10-10 21:14:29下载
    积分:1
  • 76676989
    实现钩子,VC++精选编程学习源码,很好的参考资料。(Hook, VC++ select learning programming source code, a good reference.)
    2013-11-28 10:49:43下载
    积分:1
  • SMG138
    74HC138驱动数码管程序,驱动4位共阳数码管,阳极全部高电平,138驱动段码(74HC138-driven digital control program)
    2013-12-25 15:15:10下载
    积分:1
  • Basic-knowledge-of-the-design-of-mobile-games
    手机游戏设计基础知识(关于手机java游戏的一些基础知识)。(Basic knowledge of the design of mobile games (java games on the phone some basic knowledge).)
    2009-04-13 13:50:27下载
    积分:1
  • Java RMI 编程, 实现远程方法调用, 接口提供了一些功能, 通过注册并创建实例来远程调用用户需要的服务....
    Java RMI 编程, 实现远程方法调用, 接口提供了一些功能, 通过注册并创建实例来远程调用用户需要的服务.-Java RMI programming, Remote Method Invocation, Interface provided some functions, and created examples distance call service user needs.
    2022-02-27 08:13:33下载
    积分:1
  • 23_Generation
    GENERASTION COST MINIMIZATION (OPF)
    2015-01-19 17:17:52下载
    积分:1
  • cc65-win32-2.11.0-1
    6502 c compiler free open source(6502 c compiler free open source)
    2007-06-04 15:07:10下载
    积分:1
  • palindrome
    c语言基础,判断一个字符串是否为回文的程序,仅供参考(Determine whether a string is a palindrome)
    2014-01-03 16:49:39下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载