What is the difference between double.Parse(myString)
and Double.Parse(myString)
? Is there a difference in performance or reasons I should use one but not the other?
double
is just a language alias for System.Double
(a class recognized by the CLR), so it should be exactly the same.
Are you experiencing a specific problem that would indicate otherwise?
None-what-so-ever...
double is an alias for System.Double. Nothing else.
so double.Parse is exactly the same as Double.Parse.
Nothing; One of them ( double
or Double
- don't remember) is an alias for the other.
The compiler takes care of it, so there's literally no difference.
There are other pairs of examples of this, too, like int
/ Int32
and String
/ string
Precisely,
The following table shows the keywords for built-in C# types, which are aliases of predefined types in the System namespace.
bool --> System.Boolean
decimal --> System.Decimal
double --> System.Double
int --> System.Int32
Complete list here .
In Simple word, Double is just alias for double, just Press F12 on Double Word to see this. In fact main type is double, but in .net Framework it's Double See msdn about double .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.