Even nowadays I often see underscores in Java variables and methods, an example are member variables (like "m_count" or "_count"). As far as I remember, to use underscores in these cases is called bad style by Sun.
The only place they should be used is in constants (like in "public final static int IS_OKAY = 1;"), because constants should be all upper case and not camel case. Here, the underscore should make the code more readable.
Do you think using underscores in Java is bad style? If so (or not), why?
it's just your own style,nothing a bad style code,and nothing a good style code,just difference our code with the others.
"Bad style" is very subjective. If a certain conventions works for you and your team, I think that will qualify a bad/good style.
To answer your question: I use a leading underscore to mark private variables. I find it clear and I can scan through code fast and find out what's going on.
(I almost never use "this" though, except to prevent a name clash.)
There is a reason why using underscores was considered being bad style in the old days. When a runtime compiler was something unaffordable and monitors came with astonishing 320x240 pixel resolution it was often not easy to differentiate between
_name
and__name
.