-5

Saw several code listings in which some variable declaration starts with _. For example long _variable = 0;

What variables start with the character '_' according to java code convention?

Santosh
  • 362
  • 4
  • 15

1 Answers1

1

Using an underscore in a java variable is not a good practice, unless it is a constant. See this question for more details.
Also generally names starting with _ are sometimes used as system variables and there is no sense in starting your variable with _ .

Edit: Question about constant naming conventions.

Community
  • 1
  • 1
Anonymous
  • 487
  • 1
  • 6
  • 17
  • Do you have a link to some documentation that says that constants can be named with an underscore? That would be a good thing to add to your answer. – Arc676 Jan 25 '16 at 10:01
  • 1
    Hi, added a link to naming conventions question. – Anonymous Jan 25 '16 at 10:09