Objects in Java can be named with an underscore, dollar sign, and letters. Naming is forbidden with numbers, reserved and keywords and literals.

Question: Have I named everything? And where exactly can I clarify this (I did not find it in the documentation)

    2 answers 2

    Identifier descriptions are in the JLS language specification.

    Identifier: IdentifierChars за исключением ключевых слов, логических литералов или null IdentifierChars: JavaLetter {JavaLetterOrDigit} JavaLetter: любая литера из Юникод для которой Character.isJavaIdentifierStart(int) ввернет истину JavaLetterOrDigit: любая литера из Юникод для которой Character.isJavaIdentifierPart(int) ввернет истину 
    • Character.isJavaIdentifierStart and Character.isJavaIdentifierPart - well, this is just a smart decoding. The first can be any, which can be the first, and the rest - any, which can be a part. - Qwertiy
    • @Qwertiy Unfortunately I do not know how to describe these characters differently. If you have a suggestion, then I will gladly supplement the answer. - Mikhail Vaysman
    • The latter are probably distinguished by the presence of numbers. And the first - any unicode letter and that there with the dollar. Probably. I do not know. Somewhere must be written. - Qwertiy
    • No, not only. There's still a lot of everything. - Qwertiy
    • For example, all these letters are suitable for the beginning of the identifier _ ¢ £ ¤ ¥ ؋ ৲ ৳ ৻ ૱ ௹ ฿ ៛ ‿ ⁀ ⁔ ₠ ₡ ₢ ₢ ₣ ₤ ₥ ₦ ₧ ₨ ₩ ₪ ₫ ₲ ₳ ₴ ₵ ₶ ₷ ₸ ꠸ ﷼ ︳ ︴ ﹍ ﹍ ﹎ ﹏ ﹩ $ Mikhail _ ¢ £ £ ₩ - Mikhail Vaysman

    http://ideone.com/oeGSHf

    The first character can be any Unicode letter, as well as the following characters (the decimal code is first written down, then the symbol itself after the dash):

     36 - $ 95 - _ 162 - ¢ 163 - £ 164 - ¤ 165 - ¥ 1423 - ֏ 1547 - ؋ 2546 - ৲ 2547 - ৳ 2555 - ৻ 2801 - ૱ 3065 - ௹ 3647 - ฿ 5870 - ᛮ 5871 - ᛯ 5872 - ᛰ 6107 - ៛ 8255 - ‿ 8256 - ⁀ 8276 - ⁔ 8352 - ₠ 8353 - ₡ 8354 - ₢ 8355 - ₣ 8356 - ₤ 8357 - ₥ 8358 - ₦ 8359 - ₧ 8360 - ₨ 8361 - ₩ 8362 - ₪ 8363 - ₫ 8364 - € 8365 - ₭ 8366 - ₮ 8367 - ₯ 8368 - ₰ 8369 - ₱ 8370 - ₲ 8371 - ₳ 8372 - ₴ 8373 - ₵ 8374 - ₶ 8375 - ₷ 8376 - ₸ 8377 - ₹ 8378 - ₺ 8544 - Ⅰ 8545 - Ⅱ 8546 - Ⅲ 8547 - Ⅳ 8548 - Ⅴ 8549 - Ⅵ 8550 - Ⅶ 8551 - Ⅷ 8552 - Ⅸ 8553 - Ⅹ 8554 - Ⅺ 8555 - Ⅻ 8556 - Ⅼ 8557 - Ⅽ 8558 - Ⅾ 8559 - Ⅿ 8560 - ⅰ 8561 - ⅱ 8562 - ⅲ 8563 - ⅳ 8564 - ⅴ 8565 - ⅵ 8566 - ⅶ 8567 - ⅷ 8568 - ⅸ 8569 - ⅹ 8570 - ⅺ 8571 - ⅻ 8572 - ⅼ 8573 - ⅽ 8574 - ⅾ 8575 - ⅿ 8576 - ↀ 8577 - ↁ 8578 - ↂ 8581 - ↅ 8582 - ↆ 8583 - ↇ 8584 - ↈ 12295 - 〇 12321 - 〡 12322 - 〢 12323 - 〣 12324 - 〤 12325 - 〥 12326 - 〦 12327 - 〧 12328 - 〨 12329 - 〩 12344 - 〸 12345 - 〹 12346 - 〺 42726 - ꛦ 42727 - ꛧ 42728 - ꛨ 42729 - ꛩ 42730 - ꛪ 42731 - ꛫ 42732 - ꛬ 42733 - ꛭ 42734 - ꛮ 42735 - ꛯ 43064 - ꠸ 65020 - ﷼ 65075 - ︳ 65076 - ︴ 65101 - ﹍ 65102 - ﹎ 65103 - ﹏ 65129 - ﹩ 65284 - $ 65343 - _ 65504 - ¢ 65505 - £ 65509 - ¥ 65510 - ₩