What does " strongly typed " and "weekly typed" mean?

Posted by Naimishforu under ASP.NET on 3/14/2011 | Points: 10 | Views : 19374 | Status : [Member] [MVP] | Replies : 5
What does " strongly typed " and "weekly typed" mean?

Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/



Responses

Posted by: SheoNarayan on: 3/14/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Strong type and Week type is related with the data type conversion.

Strongly Typed
A language that prevents you from executing the program on arguments that is of wrong type. For example, you can't multiple a string with the integer. In case you will try to do this (below code) in C# that is strongly types language, you shall get following error.

var i = 9;

string j = "10";
var v = i * j;


Error:
CS0019: Operator '*' cannot be applied to operands of type 'int' and 'string'

Weekly Typed
A language that implicitely try to convert required types when you perform the operation on wrong argument types. For example, above code in VB can give you "90" as the string would be converted to integer and then will be multiplied.

Hope this would help you in understanding this. For more detailed discussion on this topic, read http://en.wikipedia.org/wiki/Type-checking#Type_checking

Thanks!

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 3/14/2011 [Member] Bronze | Points: 25

Up
0
Down
chk out this link....
there is an example there, try to understand it......if you need help then just ask......

http://en.wikipedia.org/wiki/Strong_typing

Thanks and Regards
Akiii

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Naimishforu on: 3/15/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Thanks to both of you guyz......my understanding got cleared....



Thanks,
Naimish
http://dotnetinterview.zxq.net/
http://naimishpandya.blogspot.in/

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Akiii on: 3/15/2011 [Member] Bronze | Points: 25

Up
0
Down
@Naimishforu
Anytime.....

Akiii

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 3/15/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Check this link as well for the differences between them

http://allthingscs.blogspot.com/2011/03/weakly-typed-vs-strongly-typed-objects.html

Thanks
Karthik
www.f5Debug.net

Naimishforu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response