大连理工大学887软件工程类图设计题答案
VIP免费
下面给出的代码是使用 JAVA 语言对四个类的实现。为了简短起见,一些类
定义的细节没有给出,另外还省略了相应的 setter 和getter 方法。对这些代码进
行反工程,要求使用 UML 给出它们的设计类图。
class TestQuestion {
public static void main(String [] args)
{
CardList myCardList = new CardList();
Card newCard;
for (inti = 1; i<= 2; i++){
int j = i + 5;
newCard = new Card(i, j);
myCardList.insertCard(newCard);
}
}
}
class Card {
public Card(int s, int r) { suit = s; rank = r; }
protectedint suit;
protectedint rank;
...
}
classListElement {
protected ListElement prev;
protected ListElement next;
protected Card card;
...
}
class CardList {
// This method creates a new list element on the heap associated with
// the input card and inserts into the beginning of this list.
public void insertCard(Card card) { ... }
// This method removes the input card from this list.
public Card removeCard(Card card) { ... }
// This method returns the first card of this list.
public Card getFirst() { ... }
...
Protected int noOfElements;
protectedListElement first;
protectedListElement last;
}
相关推荐
-
华东政法大学805产业经济学2022年真题VIP专享
2026-01-22 999+ -
延边大学859经济管理基础管理学VIP免费
2026-02-25 999+ -
华东交通大学432统计学2020年真题VIP免费
2026-02-25 999+ -
华南师范大学802经济学原理曼昆经济学原理笔记讲义总结VIP专享
2026-02-25 999+ -
华南师范大学802经济学原理高鸿业宏观经济学名词解释VIP专享
2026-02-25 999+ -
华南师范大学802经济学原理高鸿业微观经济学名词解释VIP专享
2026-02-25 999+ -
吉林大学823经济学(政治经济学、西方经济学)宏观计算题专项VIP免费
2026-02-26 999+ -
吉林大学823经济学(政治经济学、西方经济学)经济学考研图形类汇总VIP免费
2026-02-26 999+ -
吉林大学823经济学(政治经济学、西方经济学)宏观详细版框架VIP免费
2026-02-26 999+ -
南京大学431金融学综合2026年真题(完整回忆版)VIP专享
2026-02-26 999+
作者:北木在北
分类:考研考博类
价格:1知币
属性:3 页
大小:369.02KB
格式:PDF
时间:2025-12-27
相关内容
-
华南师范大学802经济学原理高鸿业微观经济学名词解释
分类:考研考博类
时间:2026-02-25
标签:无
格式:PDF
价格:3 知币
-
吉林大学823经济学(政治经济学、西方经济学)宏观计算题专项
分类:考研考博类
时间:2026-02-26
标签:无
格式:PDF
价格:1 知币
-
吉林大学823经济学(政治经济学、西方经济学)经济学考研图形类汇总
分类:考研考博类
时间:2026-02-26
标签:无
格式:PDF
价格:1 知币
-
吉林大学823经济学(政治经济学、西方经济学)宏观详细版框架
分类:考研考博类
时间:2026-02-26
标签:无
格式:PDF
价格:1 知币
-
南京大学431金融学综合2026年真题(完整回忆版)
分类:考研考博类
时间:2026-02-26
标签:真题
格式:DOCX
价格:4.9 知币

