|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Difference between Dim I as ineteger and Dim I as New IntegerPlease let me know the difference between the following statements. Dim i as Integer Dim i as New Ineger As I tested both declares a variable 'i' of type integer intialized to value '0'. Please let me know the significance of 'New' keyword in the declaration. I suppose 'New' is used to create an object of a class, but here 'Integer' is not a Reference Type. The same with the following statements. Dim s as String Dim s as New String("s",1) Thanking you in advance. Regards Vighneswar There is no difference
except of typing length and ambigity to other .Net languages ( mather of personal prefernce i would call this ) regards Michel Posseth Show quoteHide quote "vighnesh" <vighn***@nannacomputers.com> schreef in bericht news:u0KtbXkjHHA.2272@TK2MSFTNGP02.phx.gbl... > > Hi Folks > > Please let me know the difference between the following statements. > > Dim i as Integer > Dim i as New Ineger > > As I tested both declares a variable 'i' of type integer intialized to > value '0'. > Please let me know the significance of 'New' keyword in the declaration. > I suppose 'New' is used to create an object of a class, but here 'Integer' > is not a Reference Type. The same with the following statements. > > Dim s as String > Dim s as New String("s",1) > > Thanking you in advance. > > Regards > Vighneswar > > "vighnesh" <vighn***@nannacomputers.com> schrieb: The two lines are semantically equivalent.> Please let me know the difference between the following statements. > > Dim i as Integer > Dim i as New Ineger > > As I tested both declares a variable 'i' of type integer intialized to > value '0'. > Dim s as String These lines are semantically different as 'String' is a reference type. The > Dim s as New String("s",1) first variable will be initialized to 'Nothing', the second will have the value "s". -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/>
Countdown
is there a control that displays a multi-column array of rectangles Is This Overkill? Talking with USB GPS in VB.Net Listing properties of an object Checking db connection open status File busy after sent via email Problem on shutdown computer if my appication is opened Write to an Access database Help Converting Some C# Code to Visual Basic... |
|||||||||||||||||||||||