And you should be able to replace the ??? by something more useful if you look at the Formatter class (comprehensive but difficult to understand) or the Java™ Tutorials section (brief but easy to understand). You cannot store a long as 0000012345 instead of 12345 (in fact the leading 0 in a numeric literal will produce a different value, as you doubtless already know), but you can display it as 00012345 and the Java Tutorials section shows an example very like that.
I have never tried passing "00012345" to a Scanner, nor Long.parseLong("00012345"), but you can probably pass those Strings to be parsed. Try it and see.
Please search these fora; lots of people ask that sort of question.