When/why to make function private in class?

后端 未结 7 798
攒了一身酷
攒了一身酷 2020-12-28 15:50

When should i make a function private and why is it good idea?

7条回答
  •  情歌与酒
    2020-12-28 16:22

    Before creating a function or class we should understand scope of that function or class whether it is Globally or Locally.

    eg:"ConnectionString ()". Every database connection needs "ConnectionString () " so its declared Public .

提交回复
热议问题