Standard Conventions
Is it true that Standard 开发者_Python百科convention is that variables and method identifiers start with a lower case letter.
Yes, that is the Java standard naming convention, and it's also a naming convention put into use by many other standards used by companies/coders out there. Names that begin with capitals are typically used for types, as in class names.
Also, check out the Java naming conventions documentation: http://www.oracle.com/technetwork/java/codeconventions-135099.html#367
Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.
Except for variables, all instance, class, and class constants are in mixed case with a lowercase first letter. Internal words start with capital letters. Variable names should not start with underscore _ or dollar sign $ characters, even though both are allowed.
Variable names should be short yet meaningful. The choice of a variable name should be mnemonic- that is, designed to indicate to the casual observer the intent of its use. One-character variable names should be avoided except for temporary "throwaway" variables. Common names for temporary variables are i, j, k, m, and n for integers; c, d, and e for characters.
Yes. That's correct.
Find out by yourself at the source.
The is the accepted Java convention.
Other conventions:
PackageName.ClassName.MethodName
, aka Microsoft style (See: .NET, Win32 API)
namespace::class::some_static_method_name()
, aka C++/STL/C style (also seen in most C code bases as libraryname_function_name()
)
schizo_PhrenicStylewhenyoucantKeep_things_working
- not recommended.
精彩评论