我可以简化这个java if构造吗?这对我来说似乎太冗长了,我希望缩短它。 A是持久性对象,如果第一次访问上下文,它将为空。比A被instatniated和给定的内容,如果失败,一些备份的内容是给A. if (A == null) {
A = staticGetMethod();
if (A == null) A = new BackupAContent() { ... };
有没有办法增加Perl中警告的详细程度? 我用它来产生警告。 #!/usr/bin/perl -w
我对偶尔碰到的以下内容特别感兴趣。反正Perl有打印未初始化变量的名字吗? Use of uninitialized value in printf at ./script.pl line 106, <LOG> line 323805.
是否可以使javac仅输出错误位置和错误消息,并隐藏源代码转储? 现在,我得到: $ javac t.java
t.java:1: <identifier> expected
class {
^
t.java:2: reached end of file while parsing
bar
^
t.java:4: reached end of file while parsing