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?
5 Answers
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?

- 239,200
- 50
- 490
- 574

- 18,753
- 6
- 54
- 84
-
1I want to clear up my understanding from the long comments, so: 'double' is a keyword (or alias) for System.Double, and my question should be, more correctly, "difference between double and System.Double". Am I right? – KMC Jan 14 '12 at 04:54
-
2Your question is correct (at least the way those of us on planet earth understand it) and the answers you've received (save Ali's response) answer it correctly. In short, `double` is just something that ends up meaning `System.Double` to the compiler. They are the same thing it's just that the compiler lets you use `double` for legacy compatibility. – M.Babcock Jan 14 '12 at 04:58
-
@KMC: M.Babcock says it so well I don't need to add anything to that. – Sani Huttunen Jan 14 '12 at 05:03
-
Your suspicion was correct, so I removed the weasel-words. :-) – Cody Gray - on strike Jan 14 '12 at 17:14
None-what-so-ever...
double is an alias for System.Double. Nothing else.
so double.Parse is exactly the same as Double.Parse.

- 23,620
- 6
- 72
- 79
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

- 39,603
- 20
- 94
- 123
-
-
1@KMC See this question: http://stackoverflow.com/questions/8626056/in-c-why-is-int-an-alias-for-system-int32 – Andrew Barber Jan 14 '12 at 04:00
-
1@KMC - Consider it syntactic sugar for those developers coming from a C/C++ background. – M.Babcock Jan 14 '12 at 04:03
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.

- 16,931
- 22
- 71
- 103
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.

- 4,755
- 5
- 41
- 63