KMC
KMC

Reputation: 20036

What is the difference between double.Parse and Double.Parse?

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?

Upvotes: 1

Views: 1718

Answers (5)

M.Babcock
M.Babcock

Reputation: 18965

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?

Upvotes: 4

Manish Basantani
Manish Basantani

Reputation: 17509

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.

Upvotes: 1

Lrrr
Lrrr

Reputation: 4805

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.

Upvotes: 0

Andrew Barber
Andrew Barber

Reputation: 40160

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

Upvotes: 2

Sani Huttunen
Sani Huttunen

Reputation: 24395

None-what-so-ever...
double is an alias for System.Double. Nothing else.

so double.Parse is exactly the same as Double.Parse.

Upvotes: 2

Related Questions