I just read Enhancements in Java7(
http://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html).
In that I see Underscores Numeric Literals and try Like….
int i=9_000; its OK.
But I see rules for that it also allows like…
int i=9____________________________________________________________________________________000;
Is there any end of Underscores?
No, there’s no limit. Java allows any amount of underscores although, depending on how your compiler is implemented, you may run into problems for bizarre edge cases like several billion of them 🙂
In those places where you can have underscores, the language specification does not limit the quantity. I emphasise “can” there because there are places where they’re not allowed, such as before the first digit, after the last, next to the decimal point and so on. But that’s a different issue.
However, rather than ask if it’s possible, you should instead ask what would be the point of more than one consecutive underscore.
One underscore aids readability by naturally grouping the numbers:
whereas more than one tends to reduce readability: