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!

Start Spring using IntelliJIDEAUltimate version...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Java...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How to set the SpringBoot project default run configuration list in Idea using IntelliJ...


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Dreamweaver CS6
Visual web development tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1
Powerful PHP integrated development environment

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