Why do we use _ in variable names?

Viewed 53505

I have seen variables like _ image and was wondering what _ meant?

12 Answers

The use of two underscores (`__') in identifiers is reserved for the compiler's internal use according to the ANSI-C standard.

Underscores (`_') are often used in names of library functions (such as "_main" and "_exit"). In order to avoid collisions, do not begin an identifier with an underscore.

To avoid reserved keywords, or in reserved keywords, making them more easily avoided. A single underscore is discouraged and reserved in JavaSE9.

Basically it is telling that the developer should provide the definition . In short it defines it does not have any definition .

Related