In the Java language, identifiers can contain numbers "0-9", letters "A-Z, a-z" and underscores "_", dollar signs "$" or RMB signs "¥"; but the first letter cannot be Numbers, and keywords and reserved words cannot be used as identifiers. Identifiers are case-sensitive.

Java is an object-oriented programming language that can write cross-platform application software; Java technology has excellent versatility, efficiency, and platform portability and security, widely used in personal PCs, data centers, game consoles, scientific supercomputers, mobile phones and the Internet, and has the world's largest professional community of developers. In the global industrial environment of cloud computing and mobile Internet, Java has significant advantages and broad prospects.
In the Java language, variables, constants, functions, and statement blocks all have names. We call them Java identifiers; simply put, identifiers are used to give classes , objects, methods, variables, interfaces and custom data types are named.
Naming rules for java identifiers
● Java identifiers are composed of numbers, letters and underscores (_), dollar signs ($) Or composed of RMB symbol (¥).
●The first letter cannot be a number.
●You cannot use keywords and reserved words as identifiers.
● Identifiers are case-sensitive
Java programming specifications:
1), class name and interface name: according to "Camel Size "Peak method", the first letter of each word is capitalized, and the remaining letters are lowercase, including upper and lower case. Such as MyClass
2), method name: the first letter is lowercase, the remaining letters are uppercase, uppercase and lowercase; use underscores as little as possible. Such as bothEyesOfDoll.
3), package name: all letters are lowercase. For example, com.abc.dollapp.
4), Constant name: The constant name of the basic data type uses all capital letters, and the words are separated by underscores "_". Object constants can be mixed. For example: SIZE_NAME.
5), variable name: can be written in mixed case, the first character is lowercase, and the first letter of the word is capitalized as the separator between words. Don’t use underscores and use dollar signs sparingly. When naming variables, try to make them as clear as possible.
Related video tutorial recommendations: "Java Tutorial"
The above is the detailed content of What does a java identifier contain?. For more information, please follow other related articles on the PHP Chinese website!
How do I use Maven or Gradle for advanced Java project management, build automation, and dependency resolution?Mar 17, 2025 pm 05:46 PMThe article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.
How do I create and use custom Java libraries (JAR files) with proper versioning and dependency management?Mar 17, 2025 pm 05:45 PMThe article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.
How do I implement multi-level caching in Java applications using libraries like Caffeine or Guava Cache?Mar 17, 2025 pm 05:44 PMThe article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra
How can I use JPA (Java Persistence API) for object-relational mapping with advanced features like caching and lazy loading?Mar 17, 2025 pm 05:43 PMThe article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]
How does Java's classloading mechanism work, including different classloaders and their delegation models?Mar 17, 2025 pm 05:35 PMJava's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Chinese version
Chinese version, very easy to use

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 English version
Recommended: Win version, supports code prompts!






