简体   繁体   中英

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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