你可以省略,没有PARAMS属性括号? [英] Can you omit the parenthesis from attributes with no params?
本文介绍了你可以省略,没有PARAMS属性括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我发现,当我有序列化
而不是序列化()
中,code仍然编译。
I noticed when I have Serializable
instead of Serializable()
, the code still compiles.
有没有规则这一点,你可以省略括号?它是一个好的做法呢?这似乎更易读我,除非我失去了一些东西。
Is there a rule for this that you can omit the parenthesis? Is it a good practice? It seems more readable to me unless I am missing something.
推荐答案
有关于我已经在subect看到anywehere最佳做法,没有特定的规则。
There's no particular rule regarding best practices that I've seen anywehere on the subect.
通常情况下,我发现人们谁手型的属性省略空括号,但code一代几乎总是明确地包括它们。
Generally, I find that people who hand-type their attributes omit the empty parens, but code generation almost always explicitly includes them.
这篇关于你可以省略,没有PARAMS属性括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文