This content has been marked as final. Show 2 replies
Numeric types like Long (or long) are numbers, not strings, so they have no formatting notions like leading zeroes. If you want to maintain the string "09090" keep the string around, even if you have to parse it as well. By the way, you forgot to describe what your goal is, what you are trying to do and what it has to do with leading zeroes.
One more: Why does this print false?
Hint: this generates a compile-time error:
System.out.println(07070 == 7070);
System.out.println(09090 == 9090);