Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSharp_李浩源_無26 #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Z1131857044
Copy link

No description provided.

{
if (requiredProgress < 0)
{
flag = 0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

通过flag判断显然是不正确的,输出与示例不同,事实上我也不太理解你的flag的含义

public int Num
{
get { return num; }
set { }
Copy link
Owner

@shangfengh shangfengh Jul 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果我们不希望类外能修改Num,就不应该设置这个set访问器,类内直接修改num字段

set
{
requiredProgress = (value <= 0) ? 0 : value;
num += 1;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Num表明是第几个实例化的Progress,不是指第几次Start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants