473,395 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Difference between Dim I as ineteger and Dim I as New Integer


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
May 4 '07 #1
2 7991
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
"vighnesh" <vi******@nannacomputers.comschreef in bericht
news:u0**************@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


May 4 '07 #2
"vighnesh" <vi******@nannacomputers.comschrieb:
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'.
The two lines are semantically equivalent.
Dim s as String
Dim s as New String("s",1)
These lines are semantically different as 'String' is a reference type. The
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/>

May 5 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Paulo Jan | last post by:
Hi all: I have here a table with the following schema: Table "todocinetv" Column | Type | Modifiers...
3
by: ling | last post by:
Hi, I'm trying to do fscanf from a file with integers. I've tried using both %d and %i hoping that I would figure out their difference. When I checked the man pages, the only difference I...
7
by: Bart_D | last post by:
Hi, Can anybody explain me what's the difference between for example: imports system.data implements ICallbackEventHandler inherits System.Web.UI.Page Thanks Bart
6
by: JonathanOrlev | last post by:
Hello everyone, I have a newbe question: In Access (2003) VBA, what is the difference between a Module and a Class Module in the VBA development environment? If I remember correctly, new...
16
by: somenath | last post by:
Hi All. I would like to know the following information. 1)Is there any difference between the address and integer ? For example suppose int x = 500; And int y =10; Suppose address of y is...
1
by: SanderK | last post by:
Hello, In VB6, I have a certain function that draws a 'tileset' to a picturebox. The function is from a self-written API in C++. This is how it is written in VB6; Private Declare...
6
by: lenygold via DBMonster.com | last post by:
Here is my input table: TUE MON ----------- ----------- 2 - - 25 27 - - 48 50 - - 78
0
by: Michael Rudolph | last post by:
Hi DB2 newsgroup, I have encountered a difference between our development DB2 on Windows and the test environment on AIX. If using the LOCATE scalar function with a SMALLINT as LENGTH parameter...
11
by: sunnyalways4u2000 | last post by:
hello sir, Sir will please tell me the exact difference between C and advanced C...what are the extra features or funcions...etc added in this advanced one.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.