This question might be related to today's XKCD.
I discovered today that emoji could be used in variable names.
int ಢ_ಢ = 42; //apparently something valid
Out of curiosity, is there a list of such special characters which can be used in Java, and in a way which is readable by Eclipse?
"Any emoji which is standard in the unicode character set will be a valid variable name in Java" This is just an incorrect statement. The only way you could make it technically correct would be to change "will" to "will not".
Users can not only use an emoji as a variable name but it can also be used as an alias in the import statement. In this article, you'll learn how to write code using emoji and execute it. Along with this, you'll also see how the code is translated to be understood by the python interpreter.
Variable names are case-sensitive. A variable's name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign " $ ", or the underscore character " _ ".
emoji-java is a lightweight java library that helps you use Emojis in your java applications.
Even if Java
allows to use characters from the entire Unicode set it seems like Eclipse only allows a few.
Since I couldn't find a list of supported emojis I tried it out myself and found the following as working:
☺❤☝✌☀☁❄✈☎✉✂✒✏㊙㊗❇✳✴♈♉♊♋♌♍♎♏♐♑♒♓▶◀➡↗↘↙↖↕↔↪↩⤴⤵〰✖✔™©®〽‼⁉Ⓜ♨ ♠♣♥♦☑▪▫☹♤♡♢♧☢☣☠☤†☯☮☭☥✠✙✞✟✧⋆★☆✪✫✬✭✮✯✰✡☫☬☸✵❂❀❃❁✼♫♪☃❅❆☂❦♕♛♔♖♜☾ →⇒⇨➩➪➫➬➭➮➯➲➳➵➸➻➺➼➽☜☟➹➷↶↷✆⌘⏎❥ツღ☻`
If you find more feel free to edit my answer and add them.
EDIT: I think there are now a lot more supported emojis than back then. You can also use thousands of letters from the chinese alphabet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With