473,466 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Creating objects via New

Hi...

Are there performance issues related to the way in which the New keyword is
used
in VB.NET?

For example, is there a difference betwen the following calls:

1. Dim TestString as StringBuilder = New Stringbuilder

2. Dim TestString as New StringBuilder

Thanks...
Nov 20 '05 #1
3 867
I don't believe so. Either method will create the new object. It's just a
matter of preference. I like the second method because it requires less
code.

--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic
"tinman" <dw****@yahoo.com> wrote in message
news:ut**************@TK2MSFTNGP12.phx.gbl...
Hi...

Are there performance issues related to the way in which the New keyword is used
in VB.NET?

For example, is there a difference betwen the following calls:

1. Dim TestString as StringBuilder = New Stringbuilder

2. Dim TestString as New StringBuilder

Thanks...

Nov 20 '05 #2
"tinman" <dw****@yahoo.com> schrieb

Are there performance issues related to the way in which the New
keyword is used
in VB.NET?
No.
For example, is there a difference betwen the following calls:

1. Dim TestString as StringBuilder = New Stringbuilder

2. Dim TestString as New StringBuilder

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3
* "tinman" <dw****@yahoo.com> scripsit:
Are there performance issues related to the way in which the New keyword is
used
in VB.NET?

For example, is there a difference betwen the following calls:

1. Dim TestString as StringBuilder = New Stringbuilder

2. Dim TestString as New StringBuilder


Maybe only at compile time, but not at runtime :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

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

Similar topics

3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
6
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
31
by: JoeC | last post by:
I have read books and have ideas on how to create objects. I often create my own projects and programs. They end up getting pretty complex and long. I often use objects in my programs they are...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.