gpt4 book ai didi

java - 改变方法

转载 作者:行者123 更新时间:2023-12-01 22:44:58 24 4
gpt4 key购买 nike

Add a second Toast notification that combines these two lines into one line (make sure you leave the first two lines intact!). For this second Toast, chain the show() method to the makeText() method, and use whatever String message you want.

这有什么问题吗?

Toast allDoneToast = Toast.makeText(this, "All done!", Toast.LENGTH_LONG);
allDoneToast.show();

最佳答案

听起来任务的重点是通过将方法链接在一起将这两行代码组合成一行代码 - 两种解决方案都不是“错误”或“正确”,我怀疑他们只是想让你知道你可以做到所以。

通过立即调用一个方法的结果来调用另一个方法,可以链接方法,如下所示:

Toast.makeText(this, "All done!", Toast.LENGTH_LONG).show();

关于java - 改变方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25512559/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com