Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Inheritance-Multiple/F-Sharp/inheritance-multiple.fs
Normal file
22
Task/Inheritance-Multiple/F-Sharp/inheritance-multiple.fs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
type Picture = System.Drawing.Bitmap // (a type synonym)
|
||||
|
||||
// an interface type
|
||||
type Camera =
|
||||
abstract takePicture : unit -> Picture
|
||||
|
||||
// an interface that inherits multiple interfaces
|
||||
type Camera2 =
|
||||
inherits System.ComponentModel.INotifyPropertyChanged
|
||||
inherits Camera
|
||||
|
||||
// a class with an abstract method with a default implementation
|
||||
// (usually called a virtual method)
|
||||
type MobilePhone() =
|
||||
abstract makeCall : int[] -> unit
|
||||
default x.makeCall(number) = () // empty impl
|
||||
|
||||
// a class that inherits from another class and implements an interface
|
||||
type CameraPhone() =
|
||||
inherit MobilePhone()
|
||||
interface Camera with
|
||||
member x.takePicture() = new Picture(10, 10)
|
||||
Loading…
Add table
Add a link
Reference in a new issue