Multiple choice technology programming languages

Does this code compile? Public interface MyInterface { string MyProp { get; } }

  1. Yes

  2. No, because the interface name does not start with 'I'

  3. No, because MyProp is not declared as public

  4. No, because interfaces can't contain property declaration

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The code compiles correctly. Interface members are implicitly public and abstract, so explicitly writing 'public' is unnecessary but allowed. The 'I' prefix is a naming convention (like IMyInterface) but not required by the language. Properties in interfaces are valid and must include at least a getter.