coding manual for java

First of all, I have learning Coding Rule of Alibaba Group, so I write this blog to learn it again.

1 Naming

  1. Name in code can not be starting or ending with _ or $
    :
    name/ __name / $name / name / name$ / name__

  2. Name must be in English
    :
    alibaba / google /apple
    :
    guge / pingguo

  3. Name of Class must use UpperCamelCase style except DO / BO / DTO /VO and so on.
    :
    UserDO / TcpUdpDeal
    :
    userDO / tcpudpdeala

  4. Name of function, parameter, class variable and local variable must use lowerCamelCase styple.
    :
    localValue

  5. Name of Const variables need to be writed as upperclass and words are spletted by “_”. You’d better let the name to be easy to understand and not to be too long.
    :
    MAX_STOCK_COUNT
    :
    MAX_COUNT

  6. Name of abstract class need to start with Abstract or Base; Name of exception class neet to be end with Exception; Name of test class need to be end with Test
    :
    MAX_STOCK_COUNT
    :
    MAX_COUNT

  7. Type and [] need to stay close to difine a array
    :
    int[] arrayDemo
    :
    int arrayDemop[]