Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Difference between implicit conversion and explicit conversion
1. Difference between Implicit Conversion and Explicit Conversion
S.No Implicit Conversion Explicit Conversion
1 Implicit Conversion perform In some cases we have to perform
automatically in VB.NET, that is conversions , that is the compiler does
the compiler is taking care of the not automatically convert a type to
conversion and therefore does not another . These type of conversion is
require any special syntax in the called Explicit conversion . An explicit
source code. conversion uses a type conversion
keyword, eg.CType ,CInt ,CStr etc.,
With these conversion keywords we
have to perform the Explicit
Conversion
Example for Implicit Conversion:
Dim K As Integer
Dim Q As Double
' ...
K = 432 ' Integer widens to Double, so Option Strict can be On.
Q=K
In the above example, Visual Basic .NET implicitly converts the value of K to single-precision
floating point before assigning it to Q.
Example for Explicit Conversion:
Dim K As Integer
Dim Q As Double
' ...
K = 432 ' Integer widens to Double, so Option Strict can be On.
Q=K
Q = Math.Sqrt(Q) ' Q had been assigned the value 432 from K.
K = CInt(Q) ' K now has the value 21 (rounded square root of 432).
In the above example, the CInt keyword converts the value of Q back to an integer before it is
assigned to K
And, further updates on difference between questions and answers, please visit my blog @
http://onlydifferencefaqs.blogspot.in/