Posts Tagged ‘readonly’

Readonly variables in CSharp? Really?!

A lone oryx antelope. I’m sure most of you are familiar with the keyword “const,” which allows you to declare a variable and give it a value and assures that no other code will change the value.

const int v = 23;

public void Foo()
{
    // This causes a compile error
    v = 22;
}

But what about the times when you need something that kind of works like a const but needs to be initialized by the constructor? Read the rest of this entry »

Other Related Items:

Lexmark Rom (firmware) Read-only MemoryLexmark Rom (firmware) Read-only MemoryThis is Euro freeware upgrade for lexmark printers.
Lexmark Rom (firmware) Read-only MemoryLexmark Rom (firmware) Read-only MemoryThis is Euro freeware upgrade for lexmark printers.
Pre-Algebra Solved! 2005Pre-Algebra Solved! 2005Pre-Algebra Solved! 2005 bridges the gap between basic math and algebra with intuitive design, powerful features, and a highly detailed graphical envi... Read More >
DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor