Alibabacloud.com offers a wide variety of articles about java package naming convention, easily find your java package naming convention information here online.
case, the subsequent words are in upper case, and the rest are in lower case (except for special words such as URLs). There is no special reason not to use underscores as separators.2. The name of the attribute method in Java follows the JavaBean standard:1) getter method: get + attribute name. It is better to use the is + attribute name for the boolean type, and use has and can instead of is for some specific attribute names.2) setter method: set +
long names (less than 15 letters for normal selection)
6, avoid the use of similar names, or just the case of different names
7. Avoid using underscores (except static constants, etc.)
2. Identifier type description1. Naming of packages (package)The package name should be in full English descriptors, which are made up of a lowercase word. And the pr
Package, class, interface, enumeration type, parameters, constant fields, methods and exceptions;1. Naming of packages (package)The package name should be in full English descriptors, which are made up of a lowercase word. And the prefix of the package name is always a top-l
.
The following principles must be followed when writing Java programs:If there is no good reason, never violate him.
1. PackageIt consists of lowercase letters and a few numbers.Java packages start with Java. And javax, for example, java. AWT.Packages developed by other organizations start with the Internet domain name of the organization, for example, Com. sun
As a good project manager or project leader, must develop the good excellent project naming rules and the custom. Next, you'll sort through the data you've found, and in fact, in many projects, follow the rules below.I. Name of the projectAll lowercase, such as CMS, Workdesk,jobserver, etc.Second, Java-related namingA, class naming: The first letter in front of e
This time there are two themes, the first one is too simple, is the naming rules of variables in Java, pure memory things. The second topic is to discuss a point of note for object reference variables.If you are familiar with the naming rules, look directly at the second one. (The picture above is a little bit chaotic.)
I.
Java Naming Conventions and code stylesJava Naming Conventions and code styles
Basic naming rules package name
The package name is listed gradually based on the domain name range, which is the opposite of the domain name
Java Naming rules
Hump rule:
All letters are in lowercase (including abbreviations) and the first letter of the word is in uppercase.
The first letter of each word is capitalized to get a big camper name.
Except for the first word, the first letter of each word is capitalized to get a (small) camper name.
In order to avoid ambiguity, the small and medium-sized hump method is called the hump method, and the
price are two completely different variables Oh!The following popularity of the peak camel naming method:Camel-style nomenclature is when a variable name or function name is a unique identifier consisting of one or more words, the first word starts with a lowercase letter, the first letter of the second word is capitalized, or the first letter of each word is in uppercase letters, for example: MyFirstName, Mylastname, Such variable names look like ca
Java Naming rules (reproduced)Java is a case-sensitive language that distinguishes letters. The following describes the naming rules for packages, classes, and variables in Java. (1) Package name: the
First, we use an image to illustrate what is a class, object, integration, and polymorphism.
The following uses another image to illustrate common naming rules in Java:
Java Naming Convention example Program
/*** @ (#) ExampleProgram.
HTTP://LPACEC.ITEYE.COM/BLOG/25180 Package Name: The package name is all lowercase nouns, the middle can be separated by points, for example: java.awt.event;Class Name: Capitalized, usually composed of multiple words of a class name, requiring that the first letter of each word should also be capitalized, such as Class Helloworldapp;Interface Name: The naming
understanding is only one word). The package name is in the singular form (has been complied With)
Eliminate all non-canonical abbreviations (have been complied With)
If a design pattern is used, a specific format is shown in the class name, such as Orderfactory,loginproxy. (has been complied With)
the methods and properties of an interface class cannot be added with any modifiers, including Public. Keep your code neat. Add a valid Javadoc C
1. The Java source file name Java source filename must be the same as the class name of the class defined in the source file.
2. the first part of the named package name of the package should be lowercase ASCII characters and is one of the top-level domain names, usually com, edu, gov, mil, net, org, or a nationally u
Program naming rulesTip: The module designer determines the module naming conventions for the software (such as classes, functions, variables, etc.) to ensure that the style of the module design document is consistent with the style of the code. You can extract or reference (if present) from the programming specifications of the organization.Naming rules1. Package
byte
char
double
float
int
long
short
null
True
False
Variable reference
Super
This
void
Reserved words
Goto
Const
standard naming Conventionsclass Name: first letter uppercase, the rest lowerca
Naming conventions5.1 rules that are common to all identifiersIdentifiers can only use ASCII letters and numbers, so each valid identifier name can match the regular expression \w+.Special prefixes or suffixes used in other Google programming language styles, such as name_, Mname, S_name, and Kname, are in the Java programming styleNo longer used.5.2 Rules for identifier types5.2.1
Naming rules for packages, classes, methods, properties, constants in Java1: Package: Used to classify classes that do different functions, put them under different directories (packages), and package naming conventions: reverse the company domain name as the package name. F
Package (namespace)
Java package: it is a lowercase noun that can be separated by vertices. For example, java. AWT. event;
C # namespace: the first letter is capitalized. Generally, multiple words are combined into a class name. the first letter of each word must also be capitalized, for example, system. Data. sqlc
interface name. The first letter of each word is capitalized and is case-sensitive.For example, Myclass,helloworld,time and so on.2. Method name. The first character is lowercase, the remainder is capitalized, and is case-sensitive. Use as little underline as possible.For example, Myname,settime and so on. This naming method is called Camel-named.3. Constant name. The constant name of the base data type uses all uppercase letters, and the words are s
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.