gpt4 book ai didi

annotations - Kotlin 中使用 @Annotation 和 [Annotation] 有什么区别?

转载 作者:行者123 更新时间:2023-12-01 22:39:05 25 4
gpt4 key购买 nike

例如

class LoggingService [Inject] (protected val logger: Logger)

class LoggingService @Inject (protected val logger: Logger)

我在官方文档中没有找到任何内容。

最佳答案

Kotlin 的早期预览版本支持 [Annotation] 语法。它在 Kotlin 1.0 或更高版本中不存在。

关于annotations - Kotlin 中使用 @Annotation 和 [Annotation] 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48168850/

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