Learning Visual Basic .NET's Type Rules

Recall that Visual Basic .NET is a strongly typed language. This implies that all variables declared in a VB.NET program be given an explicit data type. Furthermore, the set of values that can be assigned to a variable are limited by the variable's type. That is, a variable that is of type Integer can be assigned only positive or negative whole number values that range between, approximately, positive two billion and negative two billion.

What happens, though, when you try to assign a floatingpoint number to an integer variable or when you try to assign an integer to a floatingpoint number? What about when you try to assign a string variable to a floatingpoint variable, or an integer variable to a string ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.