F# Casting and ConversionsConversion is a process of converting type of a value to the other required type. It can be primitive or object type. F# allows casting and conversion of primitive types and object types. F# Conversion ExampleOutput: y = 44 z = 44 F# Type Casting (Upcasting, and Downcasting) ExampleF# allows us to cast object of one type to another type by using :> operator. This operator is used to upcast object. we can downcast object by using :?> operator. We have used these operators in the following program. Let's see an example. Output: BaseClass DerivedClass BaseClass
Next TopicF# Operator
|