Skip to content

Commit 07f7c86

Browse files
authored
Update interfaces.md (#5279)
Add accessibility modifier info
1 parent 94b7edc commit 07f7c86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/fsharp/language-reference/interfaces.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.date: 05/16/2016
1212
```fsharp
1313
// Interface declaration:
1414
[ attributes ]
15-
type interface-name =
15+
type [accessibility-modifier] interface-name =
1616
[ interface ] [ inherit base-interface-name ...]
1717
abstract member1 : [ argument-types1 -> ] return-type1
1818
abstract member2 : [ argument-types2 -> ] return-type2
@@ -38,6 +38,8 @@ let class-name (argument-list) =
3838
## Remarks
3939
Interface declarations resemble class declarations except that no members are implemented. Instead, all the members are abstract, as indicated by the keyword `abstract`. You do not provide a method body for abstract methods. However, you can provide a default implementation by also including a separate definition of the member as a method together with the `default` keyword. Doing so is equivalent to creating a virtual method in a base class in other .NET languages. Such a virtual method can be overridden in classes that implement the interface.
4040

41+
The default accessibility for interfaces is `public`.
42+
4143
You can optionally give each method parameter a name using normal F# syntax:
4244

4345
[!code-fsharp[Main](../../../samples/snippets/fsharp/lang-ref-1/snippet24032.fs)]

0 commit comments

Comments
 (0)