Defining Local Variable const vs Class const

后端 未结 6 1203
时光说笑
时光说笑 2020-12-30 18:12

If I am using a constant that is needed only in a method, is it best to declare the const within the method scope, or in the class scope? Is there better pe

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-30 18:57

    Depends where do you want to use it , if you are going to use in other methods define it in the class , if you are going to use it only in one method define it in the method you are going to use it :)

提交回复
热议问题