登录
首页 » Java » Mypicture

Mypicture

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

  • 01_《Delphi 7基础
    01_《Delphi 7基础编程》配套光盘(Delphi 7 Basic Programming Matching CD)
    2020-06-24 23:00:01下载
    积分:1
  • facility
    用Cplex求解一个仓库选址的问题,目标是使总成本最小。(a program using Cplex on C++ platform to solve a warehouse site selection problem to minimize total costs.)
    2021-03-06 21:29:31下载
    积分:1
  • 438552308tshs
    web 系统开发实例,采用Struts+Hibernate框架编写,初学者学习.(Web system development example, use Struts+ Hibernate framework to write, beginners to learn.)
    2012-06-27 20:56:52下载
    积分:1
  • Galaxy-Tab-pdf
    Galaxy Tab - Learn how Navigate Galaxy Tab
    2012-08-16 15:11:15下载
    积分:1
  • MyCMinus
    自作的C-编译器,涉及词法分析,语法分析,词义分析。用的C语言编写。VC++调试。(Self-made ​ ​ C-compiler, involving lexical analysis, syntax analysis, semantic analysis. The C language. VC++ debugging.)
    2012-05-08 22:54:08下载
    积分:1
  • Practical_Quiz_4
    Practical_Quiz_4 ssd1 very understandable
    2014-12-13 17:08:02下载
    积分:1
  • 通过建立通信套接字,必须理解如何使用…
    通过winsock建立通信,必须了解如何利用如何指定的协议为工作站定址,-Winsock through the establishment of communications, must understand how to use the agreement specify how the workstation is located,
    2022-12-26 02:15:03下载
    积分:1
  • 《VC网络高级》随书光盘,内部附有教材所有范例的源码。...
    《VC网络高级编程》随书光盘,内部附有教材所有范例的源码。-VC Network Advanced Programming book with CD-ROM, internal materials with the source code of all examples.
    2022-12-25 00:45:04下载
    积分:1
  • opnet_aloha
    实例 用Modeler搭建一个ALOHA协议仿真平台,进一步熟悉Modeler节点级和进程级的操作,深化三层建模机制。(进程->节点->网络) (Examples ALOHA protocol with Modeler to build a simulation platform to further familiarize Modeler node level and process-level operations, deepening three modeling mechanism. (Process-> Node-> Network))
    2014-01-05 17:08:34下载
    积分:1
  • H2RCode
    carrydrop撒钱的例程,是repastJ软件的经典教程(throw money routines,It Is a classic repastJ software tutorials)
    2021-04-15 16:48:54下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载