Javatpoint Logo
Javatpoint Logo

F# Type Extensions

Type extension allows you to add new members to your previously defined object type.

The syntax of Type Extensions in F# language is given below:

F# Type Extension Example

In the following example, we are adding new method to previous defined class. Here, we are calling methods by using a single object of the class.

Output:

Class before extension
Class after extension




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA