登录
首页 » Java » Mypicture

Mypicture

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

  • 765476
    改变对话框的背景颜色,VC++精选编程学习源码,很好的参考资料。(Dialog box to change the background color, VC++ select learning programming source code, a good reference.)
    2013-12-01 22:03:08下载
    积分:1
  • Psuedo_Codehhhh
    Pseudo Random Network Coding using Diagonal Matrix
    2015-04-07 15:29:57下载
    积分:1
  • Tutorial
    This is a c++ nice tutorial. It was written way back, but is very useful.
    2009-06-18 22:23:17下载
    积分:1
  • ClassMemeberPriviledge
    实现一个程序,对用户输入的类权限、成员权限、以及使用该类对象的环境与这个类的关系,判断这个环境中能不能访问这个类的这个成员。 4. 背景知识介绍:对类成员的访问权限由3个方面决定:(1)类的访问权限(public或default),(2)成员变量的访问权限(public, protected, default或private),以及环境与类的相互关系(同类SameClass,同包不同类SamePackageNoteSameClass,不同包但为子类OtherPackageSubClass,不同包非子类OtherPackageNotSubClass)。例如,如果一个类A是public的,它的一个成员变量x是protected的,则这个成员变量的访问权限是default的,试图访问这个类的一个运行环境与A的关系是OtherPackageSubClass,则这个环境中能够访问变量x。(Implement a program, the relationship between the classes of permissions, user input member permissions, as well as the environment of use of such objects of this class, it is judged in this environment can not access this members of this class. 4. Background knowledge: the access rights of the class members decided by three aspects: (1) access rights (public or default), (2) the member variable access rights (public, protected, default or private), as well as environmental and the relationship of the class (of similar SameClass, same package different classes SamePackageNoteSameClass, different packages, but for subclass OtherPackageSubClass, different package non-subclass OtherPackageNotSubClass). For example, if a class A is public, it s a member variable x is protected, the access rights of the member variables is default, tries to access a runtime environment for this class A relationship is OtherPackageSubClass this environment be able to access the variable x.)
    2013-04-01 20:00:25下载
    积分:1
  • iddkxhee
    An example of showing a progress bar when displaying a subtree
    2017-03-23 15:27:23下载
    积分:1
  • java
    说明:  LOF算法的Java实现,针对于聚类算法LOF,写了简易的Java实现代码来帮助初学者了解(Java Implementation of LOF Algorithms)
    2019-03-18 14:55:39下载
    积分:1
  • 关于winpcap的一些认识
    关于winpcap的一些认识-on the understanding winpcap
    2023-05-08 22:15:04下载
    积分:1
  • 多项式加法
    多项式加法C++程序,包括动态链表、静态链表、插入排序、sort函数法(Polynomial addition C++ procedures, including dynamic list, static list, insert sort, sort function method)
    2017-06-18 15:44:11下载
    积分:1
  • 获取Internet服务器的时间,获取Internet服务器的时间
    获取Internet服务器的时间,获取Internet服务器的时间 -Access to Internet time server, access to Internet time server
    2022-04-24 05:36:30下载
    积分:1
  • to_database
    读取数据库信息,显示有关数据信息,对数据库信息的显示。(look up DataBase)
    2014-05-14 18:37:48下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载