java coding conventions

Posted: December 17, 2014 in java basics

Class and Interfaces – The First letter should be capital, and first letter of the inner words should be Capital.

Example : Account

PrintWriter

Emp

Runnable

Methods – The First Letter should be lowercase, and then normal camelCase rules should be used. Name should be noun-verb pairs.

Example

getBalance

setCustomerName

Variables – Same rule as Method Rule.

Example

buttonWidth

myString

Constants – All in Uppercase.

Example

MIN_HEIGHT

________________________________________________________________________________

Leave a comment