mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-24 15:51:41 +03:00
Merge pull request #1741 from chriszimmerman/master
[C#] Fixed minor grammatical changes. Added bitwise enum operator information.
This commit is contained in:
commit
1582603b62
@ -694,7 +694,10 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
public BikeBrand Brand; // After declaring an enum type, we can declare the field of this type
|
public BikeBrand Brand; // After declaring an enum type, we can declare the field of this type
|
||||||
|
|
||||||
// Decorate an enum with the FlagsAttribute to indicate that multiple values can be switched on
|
// Decorate an enum with the FlagsAttribute to indicate that multiple values can be switched on
|
||||||
[Flags] // Any class derived from Attribute can be used to decorate types, methods, parameters etc
|
// Any class derived from Attribute can be used to decorate types, methods, parameters etc
|
||||||
|
// Bitwise operators & and | can be used to perform and/or operations
|
||||||
|
|
||||||
|
[Flags]
|
||||||
public enum BikeAccessories
|
public enum BikeAccessories
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
@ -881,8 +884,8 @@ on a new line! ""Wow!"", the masses cried";
|
|||||||
bool Broken { get; } // interfaces can contain properties as well as methods & events
|
bool Broken { get; } // interfaces can contain properties as well as methods & events
|
||||||
}
|
}
|
||||||
|
|
||||||
// Class can inherit only one other class, but can implement any amount of interfaces, however
|
// Classes can inherit only one other class, but can implement any amount of interfaces,
|
||||||
// the base class name must be the first in the list and all interfaces follow
|
// however the base class name must be the first in the list and all interfaces follow
|
||||||
class MountainBike : Bicycle, IJumpable, IBreakable
|
class MountainBike : Bicycle, IJumpable, IBreakable
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user