简体   繁体   English

Java中方法名称前的下划线是什么意思?

[英]What is the meaning of underscore before a method name in Java?

I have come across methods like 我遇到过类似的方法

if (_log.isInfoEnabled())
    _log.info("Kicking the Supplier Info at " + importFrom + " with JobID " + jobId);

where _ is present before a method name. 方法名称前的_位置。 What does that mean? 这意味着什么?

An underscore (_) before a variable name or function name doesn't mean anything. 变量名或函数名前的下划线(_)并不代表任何含义。 It's just the way the programmer has named the function. 这只是程序员命名函数的方式。

You could for example use it to let the other programmers know it is a private function or a global function. 例如,您可以使用它来让其他程序员知道它是私有函数还是全局函数。 It all depends on what you agree with the programmer. 这完全取决于您对程序员的同意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM