Why are there no modifiers (public, private, protected) before the methods and properties that define the interface?

Possible duplicate:
Is there a reason why you cannot define an access modifier for a method or interface?

Hello,

I'm interested in interfaces. Say I have the following interface definition

public interface IPersone
{
  string FirstName { get; set; }
  string LastName { get; set; }
  int CalculateAge(int YearOfBirth);
}

Why are there no modifiers (public, private, protected) before the methods and properties that define the interface? Is there a reason for this?

thanks for the help

+3
source share
6 answers

Quote from MSDN : members of an interface are always open, because the purpose of an interface is to include other types to access a class or structure.

+7
source

.

- , , , . .

+3

, . , .

+3

, , private protected, , , .

, "" , .

+2
+1

. / .. - , .

, ?.

0
source

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


All Articles