Naming convention for objects in java

后端 未结 6 676
-上瘾入骨i
-上瘾入骨i 2021-01-04 09:12

I had started programming in java 2 years back. Seniors in our project at that time had advised me to append \'obj\' to the name of the object which is being created.

<
6条回答
  •  梦毁少年i
    2021-01-04 09:52

    class name in small letters is Sun/Oracle standard.

    when you are working for a company,

    depending upon project naming conventions it may vary.

    Car car=new Car(); //good to follow
    

    if It is Singleton pattern,you may give a name like below

     private static final Car singletonCar=new Car();
    

提交回复
热议问题