Tag Archives: properties

Classes and inheritance in F#

This example is similar to the Classes in Ruby example. It demonstrates a superclass for representing a car. Two subclasses are used for representing a hero car and a villain car, they inherit from the superclass.

Posted in F# | Also tagged , , , , , , , , , , | Leave a comment

Properties in C#

Properties in C# can be used to set or get the value of an attribute. Suppose you have a class called Person which has the attributes name and age. class Person { String name; int age; public Person(String name, int age){ this.name = name; this.age = age; } } The attributes of the Person class [...]

Posted in C# | Also tagged , , , , , | Leave a comment