带参数的uml类关系图构造函数

编程入门 行业动态 更新时间:2024-10-19 01:24:40
本文介绍了带参数的uml类关系图构造函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是一个完全的新手,因此我需要一些帮助。

如何创建带参数的uml类图和构造函数。

默认(无参数),您执行

policyholder()进行图表和伪代码

对于参数,您会做同样的事情

用于类图和伪代码的policyholder(策略编号,服务类别和客户年龄)。 / p>

它还要求将每个属性初始化为可实例化此类型对象的值,如果策略号不在1000和999之间(包括1000和999),则设置该策略号到0。(策略号是属性)

解决方案

常见的方法是编写类似方法的构造函数,并简单地省略返回类型。

如果要特别清晰,可以添加<< constructor& gt;> 在前面。

I am a complete ROOKIE at this so I need some help on it.

How would you create uml class diagram and constructors with parameters.

for default (no parameters) you do

policyholder() for diagram and pseudo-code

for parameters would you do the same thing

policyholder (policynumber, service class, and customer age) for class diagrams and pseudo-code.

It also asked to initialize each attribute to value where an object of this type can be instantiated, If a policy number is not between 1000 and 999 inclusive, then set the policy number to 0. (policy number is attribute)

解决方案

The common way is to write constructors like methods and simply omit the return type.

If you want to be extra clear, you can add <<constructor>> in front.

更多推荐

带参数的uml类关系图构造函数

本文发布于:2023-10-24 20:14:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1524894.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:函数   参数   关系   uml

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!