In the later versions of Visual Basic and C# (2008 and later), you can define variables without explicitly setting their data type. And, when doing so, you can still get the benefits of strongly typed variables (compiler checking, memory allocation, and more). The compilers actually infer the data type you intend to use based on your code. This process is called local type inference or implicit typing.
For example, consider the following lines of code. Here you create a variable of type
String and assign a value.
string companyName = "Contoso";
Dim companyName As String = "Contoso"
Now, let’s look at the same line of code using type ...