返回客户是什么意思?

发布于 2024-08-13 02:05:28 字数 193 浏览 6 评论 0原文

“返回客户”是什么意思?

我的老师在作业中要求编写一个返回日期和客户的方法。这是她的确切措辞:

“您还应该重写 ToString 方法,以返回日期和客户端。(DateTime 定义了合理的 ToString 方法。使用它。)我发现使用“\t”(制表符)有助于”

我不确定她说要归还客户时在问什么。我知道如何返回日期。谢谢。

What does it mean to "return the client?"

My teacher asked in an assignment to write a method that will return the date and the client. Here is her exact wording:

" You should also override the ToString method, to return the date and the client. (DateTime has a reasonable ToString method defined. Use it.) I found using "\t" (the tab symbol) helpful in lining up columns. "

I'm not sure what she is asking when she says to return the client. I understand how to return the date. Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

原谅过去的我 2024-08-20 02:05:28

也许你应该问她。

在工作世界中,您需要从客户那里获得尽可能多的关于可交付成果的说明。

Maybe you should ask her.

In the working world you'll want to get as much clarification from your customer on the deliverables as required.

铜锣湾横着走 2024-08-20 02:05:28

也许她的意思是客户端(函数的调用者?)

如果您的对象中有其他数据,也许她希望您以某种方式返回它(而不是默认的 ToString() 行为?

maybe she meant to the client (the caller of the function ?)

if you have other data in your object, maybe she wants you to return it in a certain way (and not the default ToString() behaviour ?

故笙诉离歌 2024-08-20 02:05:28

也许客户端就是您使用 ToString 的对象。
像 intSomeInteger.ToString

Maybe the client is the object you use ToString on.
Like intSomeInteger.ToString

一杯敬自由 2024-08-20 02:05:28

可能是一个拼写错误 - 也许不是“返回日期和客户”,她的意思是“将日期返回给客户”?

Might be a typo -- maybe instead of "return the date and the client" she meant "return the date to the client"?

中二柚 2024-08-20 02:05:28

我的猜测是您有一个包含 DateTime 和 Client 的类,如下所示:

class MyClass
{
   public DateTime Date {get; set;}
   public Client MyClient {get; set;}
}

然后任务是将 MyClass.ToString() 和可能的 Client.ToString() 重写为如下所示:

class Client
{
   public string Name {get; set;}
   public override ToString()
   { 
    return Name;
   }
}

class MyClass
{
   public DateTime Date {get; set;}
   public Client MyClient {get; set;}
   public override ToString()
   { 
    return string.Format("Client: {0}; Date: {1}", MyClient, Date);
   }
}

My guess is you have a class containing a DateTime and a Client, something like:

class MyClass
{
   public DateTime Date {get; set;}
   public Client MyClient {get; set;}
}

The task would be then to override MyClass.ToString() and probably Client.ToString() to something like:

class Client
{
   public string Name {get; set;}
   public override ToString()
   { 
    return Name;
   }
}

class MyClass
{
   public DateTime Date {get; set;}
   public Client MyClient {get; set;}
   public override ToString()
   { 
    return string.Format("Client: {0}; Date: {1}", MyClient, Date);
   }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文