What are the option statements that are supported in vb.net?

 Posted by Kmandapalli on 1/20/2014 | Category: VB.NET Interview questions | Views: 1166 | Points: 40

Option explicit:
It is by default ON for vb.net programming.
By setting the option explicit ON, avoids implicitly declaring variables and hence writing better code. This forces the developers to explicitly declare the variables using the Dim keyword and specifying the data type.

Option compare:
By default, the option compare is bit.
However we can change it to text if needed.

Option strict:
It is by default set to OFF mode. Its preferable to write the code by setting the Option strict mode ON, as it prevents implicit type conversions by the compiler which is preferable to develop the code.

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response