EN
Java - methods naming convention, ideas and examples
3
points
Methods in java should be named as verb.
Method names examples in java:
- set
- get
- is (isDone)
- read
- write
- execute
- make
- run
- call
- give
- calculate
- send
- find
- add
- subtract
- invoke
- select
- delete
- insert
- update
- move
- go
- cancel
- do
- append
- pay
- look (look for somethin
- count
- flush
- register
- unregister
- deregister
- put
- change
- connect
- disconnect
- parse
- reset
- build
- clear
- contains
- check
- serialize
- deserialize
- replace
- equals
- end
- endsWith
- startsWith
- compare
- convert
- exchange
- revert
- contains
- concatenate
- toLowerCase
- toUpperCase
- split
- match
- isEmpty
- indexOf
- offset
- split
- notify
- wait
- determine
- designate
- addAll
- iterate
- trim
- reduce
- cut
- restrict
- limit
- confirm
- fix
- acknowledge
- install
- focus
- setUp
- repair
- attach
- reset
- adapt
- bind
- mark
- record
- enroll
- reject
- peak
- see
- quit
- display
- create
- collect
- commit
Usually used in scripting:
- kill
- start
- stop
- restart
- relaunch
- keep it alive
Other useful example:
- giveDirection
- calculateDistance
- makeSomething
- append (StringBuilder, Builders in general)
- run (Runnable)
- get, set (java pojos)
- isDone (java boolean)
- isDetected
- toFixedPrecisionIfNotNull
Also take a look at post with java class, utils, interface naming convention and examples here: