Java's children's shoes know that Java's packages, classes, excuses, methods, variables, constants, Java EE Three-layer model, etc. have a set of rules for naming.I study each language will pay attention to the corresponding naming rules, one reflects their comparative professional, and second convenient after checking, see the name to know what type, how much memory, use is correct, etc. three can be used for other people's reference.Of course, Learn
is named using lowercase letters and underscores (beginning with lowercase letters), such as get_client_ip; constant named constants are named with uppercase letters and underscores, such as App_debug and App_mode; Configure named configuration parameters to be named with lowercase and underscores, for example url_route_on; Data table and field named Data tables and fields are named in lowercase and underlined, and note that field names do not begin with an underscore, such as the Think_user ta
Used to declare fp_strict (single-precision or double-precision floating-point number) expressions that follow the IEEE 754 arithmetic specification
Super
Indicates a reference to the parent type of the current object or a constructor for the parent type
Switch
Guide words for Branching statement structures
Synchronized
Indicates that a piece of code needs to be executed synchronously
This
Reference to the current
description of the class** @author Class Creator name* @Date Date Created* @version 1.00*/2. attribute CommentYou must precede each property with a property comment, and the comment template is as follows:/** Tip Information */Private String STRMSG = null;3. Method CommentYou must add a method comment before each method, and the comment template is as follows:/*** Detailed instructions for using the
resolution. See below.*Ipadportrait:768 x 1024px, 768 x 1024pointlandscape:1024 x 768px, 1024x768 x 768pointStatus bar:20px, 20pointdpi:132dpiColor Mode:8bit RGBColor Temperature:warmApplication icon:72 x px, XAppStore icon:512 x px, XSpotlight Search icon (Results): X-px, X-pointSpotlight Search icon (settings): x px, XDocument icon:64 x px, XWebclip icon:72 x px, XToolbar icon:20 x + px, X-pointTab bar icon:30 x px, XLaunch Image:see above Portrait/landscapeNotes:many apps include a rounded m
Method Naming conventionsA method naming convention was previously mentioned in the section "Operator overloading": The first character of the method determines the priority of the method. Now say another naming convention: If the method ends with a colon (:), the call target is the instance following the operator. For example, the following:
First, naming norms1, the project name all lowercase2. Package name All lowercase3. The first letter of the class name is capitalized, if the class name consists of multiple words, the first letter of each word is capitalized. Public class myfirstclass{}4, the variable name, the method name lowercase, if the name consi
method facilitates the stack traceBadvar log = function (msg) {Console.log (msg);};/ /goodvar log = function log (msg) {Console.log (msg);};If the file is exported as a class, the filename should be consistent with the class nameFile Contentsclass CheckBox {//...} Module.exports = checkbox;//in some other file//badvar checkbox = require ('./checkbox ');//Badvar checkbox = require ('./ Check_box ');//Goodva
(read-only)3. Naming conventionsVariable and method parameter naming: Variable description According to different data type prefix + First letter capitalization
Type
Prefix
Example
Array
Arr
Arrshoppinglist
Boolean
bln
Blnispostback
Byte
Byt
Bytpixelvalue
Char
Chr
Chrdelimiter
): return self.__var_3 if __name__== "__main__": obj = MyClass () print obj.var_1 print obj._var_2 print obj.get_var_3 () # no more errors
Four, the other should pay attention to
Do not use the first letter to identify the variable type (such as Ivalue) in a language like C, because Python determines the type when it is interpreted.
Because exceptions are also a class, follow the
Python Variable Naming conventions1. To have descriptive2. Variable names can only be: numbers, letters, can not be spaces or special characters, such as: (#?. ,¥$*~!) etc.3. Cannot be Chinese4. Cannot start with a number5. Reserved characters cannot be used, as follows:[' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ',
1. keywordsC # defines some keywords (public/static/void/class/int/string) that are used to form the basic syntax of C #.The blue word in VS is the key word.The Main, String, console, and so on are not keywords. And just. NET class Library provides a number of methods, properties, etc... In theory, if you don't reference these libraries, there's no such stuff.2. IdentifiersIdentifiers are used to name class
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
Variables are stored in memory address, when a variable is defined, we can find the memory address through the variable name, you can modify the value of the memory range.
Naming conventions for identifiers: initials: Letters, underscores, $ symbols, remainder: Numbers, letters, underscores, $.
Identifiers should avoid keywords inside Java
If the variable name is made up of multiple English words,
Date Created* @version 1.00*/2. attribute CommentYou must precede each property with a property comment, and the comment template is as follows:/** Tip Information */Private String STRMSG = null;3. Method CommentYou must add a method comment before each method, and the comment template is as follows:/*** Detailed instructions for using the class method** Instructions for use of @param parameter 1 parameter 1* @return A description of the return resul
Date Created* @version 1.00*/2. attribute CommentYou must precede each property with a property comment, and the comment template is as follows:/** Tip Information */Private String STRMSG = null;3. Method CommentYou must add a method comment before each method, and the comment template is as follows:/*** Detailed instructions for using the class method** Instructions for use of @param parameter 1 parameter 1* @return A description of the return resul
type varies by typeResult set DataSet Getbyusername (String UserName)//input parameter type varies by typeBLL The class name Sysuserbll method is consistent with the Dal classThe stored procedure naming table corresponds to the Dal method1. Adding Up_tb_sysuser_Add2, modify Up_tb_sysuser_Edit3. Delete Up_tb_sysuser_Del4. Read a single entity Up_tb_sysuser_Get by ID5, according to the conditions of the page
Java package names are composed of lowercase words, the class name is capitalized, and the path of the package conforms to the definition of the developed system module, such as production to production, material to material, base class to basic class. In order to see the package name to understand which module, so directly to the corresponding package to find th
ReproducedOriginal address: http://blog.csdn.net/kongjiea/article/details/45365753Java package names are composed of lowercase words, the class name is capitalized, and the path of the package conforms to the definition of the developed system module, such as production to production, material to material, base class to basic class. In order to see the package na
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.