Designating a group of members as private / public in C #

in a C ++ class declaration, you can mark a group of members as confidential or public, for example

private:
  int x;
  double y;

There seems to be no way to do this in C #. I'm wrong?

+3
source share
3 answers

No, you cannot do this in C #.

At best, you can use the default visibility for members, which is private, rather than using confidential, but for the public you must specify it for all members.

+7
source

You're right. Although, if you leave the visibility keyword completely, the member will be closed by default.

+2
source

, . , .

+1

Source: https://habr.com/ru/post/1703190/


All Articles