T
TonyJ
Hello!!
Assume I have this class declaration of MyTest below.
I just want to check with you if the two declarations for tal1 and tal2 is
almost the same.
The only difference is that const is set at compile but readonly can be set
at compile time or run time appart from
that they are the same.
Both is actually a class field because const is always automatically static
so for me these two
decalations is almost the same appart from my comment above.
Do you agree?
class MyTest
{
public static readonly int tal1 = 1;
public const int tal2 = 1;
....
}
//Tony
Assume I have this class declaration of MyTest below.
I just want to check with you if the two declarations for tal1 and tal2 is
almost the same.
The only difference is that const is set at compile but readonly can be set
at compile time or run time appart from
that they are the same.
Both is actually a class field because const is always automatically static
so for me these two
decalations is almost the same appart from my comment above.
Do you agree?
class MyTest
{
public static readonly int tal1 = 1;
public const int tal2 = 1;
....
}
//Tony