riana
riana

Reputation: 11

Standard Conventions

Is it true that Standard convention is that variables and method identifiers start with a lower case letter.

Upvotes: 1

Views: 128

Answers (4)

Yann Ramin
Yann Ramin

Reputation: 33177

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.

Upvotes: 0

vanza
vanza

Reputation: 9903

Find out by yourself at the source.

Upvotes: 0

wkl
wkl

Reputation: 79921

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.

Upvotes: 7

EboMike
EboMike

Reputation: 77752

Yes. That's correct.

Upvotes: 1

Related Questions