No, it is not possible to submit your own literals in Java. The language specification provides syntax for numeric, character, and string literals and what it is.
You cannot even add your own implicit conversions from an existing type with a literal representation to your own types (as you can in C # - as an example of a "close relative") in Java.
source share