finance_teacher
asked on
C# -- what is "strongly-typed" ?
What does "strongly-typed" mean ?
angelIII is correct because in line 1, the value 1 is an integer not a string (the expected data type).
string x = "Hello";
x = "World";
x = 0.00; <-- This line would fail because 0.00 is a double.
However,
if you do:
x = 0.00.ToString(); <-- This line would work because the value is converted to a string first.
Well, I think of strongly-typed as being "intellisenseable". A DataTable that is strongly typed can have its fields named instead of indexed (dt.Rows.FirstName instead of dt.Rows["FirstName"]). Also, you can have a typo in the last case but not in the first case (without getting a compile error).
Gary Davis
Gary Davis
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window