C# Quick Syntax Reference by Mikael Olsson

C# Quick Syntax Reference by Mikael Olsson

Author:Mikael Olsson
Language: eng
Format: epub, mobi, pdf
ISBN: 9781430262800
Publisher: Apress


Static classes

A class can also be marked static if it only contains static members and constant fields. A static class cannot be inherited or instantiated into an object. Attempting to do so will cause a compile-time error.

static class MyCircle {}

Static constructor

A static constructor can perform any actions needed to initialize a class. Typically, these actions involve initializing static fields that cannot be initialized as they are declared. This can be necessary if their initialization requires more than one line, or some other logic, to be initialized.

class MyClass

{

static int[] array = new int[5];



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.