登录
首页 » Java » Mypicture

Mypicture

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

  • vs+SQL图书管理系统
    说明:  实现了中等难度的图书管理系统,可以进行图书统计,检索,借阅,归还等等(It realizes a medium-difficulty library management system, which can carry out book statistics, retrieval, borrowing, returning and so on.)
    2020-06-19 23:20:02下载
    积分:1
  • RabbitMQ
    使用python对rabbitmq的简单练习demo(Simple practice demo of rabbitmq using Python)
    2020-06-22 11:40:01下载
    积分:1
  • IOCP的例子 IOCP的例子
    IOCP的编程例子 IOCP的编程例子-IOCP programming examples IOCP programming examples
    2022-03-19 23:08:02下载
    积分:1
  • GM_demo
    灰度预测模型,用于做评价,可更改。使用MATLAB实现。(Gray prediction model)
    2021-01-07 22:18:51下载
    积分:1
  • Mesh election algorithm souce code for IEEE 802.16 WiMax mesh mode
    IEEE 802.16 WiMax mesh mode MAC层 mesh election algorithm的C++ 代码,做网络仿真的朋友可能需要-Mesh election algorithm souce code for IEEE 802.16 WiMax mesh mode
    2022-06-26 15:16:33下载
    积分:1
  • code
    在给定字符串中找出单词( “单词”由小写字母字符大写字母和构成,其他非字母字符视为单词的间隔, 如、问空格号、数字等等;另外单个字母不算单词);找到单词后,按照长度进行降序排序, (排序时如果长度相同,则按出现的顺序进行排列),然后输出到一个新的字符串中;如果某个单词重复出现多次, 则只输出一次;如果整个输入的字符串中没有找到单词,请输出空串。输出的单词之间使用一个“空格”隔开, 最后一个单词后不加空格。(Identify the word (" word" character from the uppercase and lowercase letters constituted, other non-alphabetic characters as word spacing, such as asking a space number, number, etc. another is not a single letter word) in a given string find words after descending order according to length, (if the same length, the order stated that appears when sorting arranged), and then output to a new string If a word is repeated several times, only output once If the entire input string is not found in word, outputs an empty string. Used between the output of a word " space" separated, no spaces after the last word.)
    2014-02-23 00:19:04下载
    积分:1
  • Matlab
    LDPC校验矩阵生成、高斯消去法编码、BP译码程序,可以作为自己编写LDPC编译码程序的参考。因为matlab代码效率不高,所以这个程序仿真起来比较慢.(LDPC check matrix generation, Gaussian elimination coding, BP decoding procedure can be used as its own procedures for the preparation of LDPC codec reference. Because matlab code efficiency is not high, so this process is relatively slow simulation together.)
    2008-05-22 23:08:39下载
    积分:1
  • Eight_puzzle
    八数码问题和舰科技符合时刻记得和反馈记得和反馈及时反馈记得是(eightnumberggfdghffhgfhgfhgfhgfhjgjghkj)
    2009-05-25 01:21:09下载
    积分:1
  • file under windows transmission network programming, the use of socket programmi...
    windows下文件传送网络编程,使用套接字编程,客户端,服务端程序,完整,可以运行-file under windows transmission network programming, the use of socket programming, client, server-side procedures, integrity, can run
    2022-05-23 11:39:46下载
    积分:1
  • pvb-gambardbxxxx
    save picture webcam to computer
    2014-02-05 11:23:41下载
    积分:1
  • 696518资源总数
  • 105179会员总数
  • 5今日下载