Sealed classes and methods: Difference between revisions

Content added Content deleted
(Added Go)
(Added C)
Line 21: Line 21:
* [[Inheritance/Single]]
* [[Inheritance/Single]]
* [[Inheritance/Multiple]]
* [[Inheritance/Multiple]]

=={{header|C}}==
C isn't an object oriented language though it can and has been used to create other languages which are.

It has structs rather than classes which are just a collection of fields. Methods on a struct can be simulated by functions whose first argument is a pointer to the struct.

However, there is no way to simulate inheritance of one struct by another. A struct can contain a field of another struct type but this is not the same as 'struct embedding' in the Go language.

So, for the purposes of this task, we can say that structs and simulated methods in C are by their nature always sealed.


=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==