473,396 Members | 1,923 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,396 software developers and data experts.

C# Fundamentals Part 3: ReferenceEquals question

Hi NG!

In my book I have the following code simple and I tested it:

public class Base : ICloneable
{
public int Age;
public string Name;

public Base(string myname)
{
Name = myname;
}

public Object Clone()
{
return MemberwiseClone();
}

public static void Main(String[] argv)
{
Base myTest = new Base("Joanna");
myTest.Age = 36;
Base clone1 = (Base) myTest.Clone();
Base clone2 = myTest;

bool myBTest = false;
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns true

myBTest = Object.ReferenceEquals(myTest.Age, clone1.Age);
//Book says true
//My Test returns false

myTest.Name = "Julie";
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns false

myBTest = Object.ReferenceEquals(myTest.Name, clone2.Name);
//Book saya true
//my Test returns true
}
}

So I'm a little confused!
With the method MemberwiseClone I do a Shallow copy. That means all
value type would be copied and of the reference types just the pointer
in the variable. Or do i understand this wrong ?

Case 1:
A string is a reference type so it is clear for me, why it results as
true. The pointers points to the same string. Or not ?

Case 2:
Why does this return false ? I guess because a boxing of the to integers
is needed ?

Case 3:
Does this return wrong, because "Julie" could be written as new
String("Julie"); ?

Case 4:
It is clear, because they are two variable which points to the same
instance of the class Base.

Thanks for help!
Regards
Marcel

Mar 31 '06 #1
20 1588
if you'd do:

Base clone1 = myTest
Base clone2 = (Base) myTest.Clone();

instead, it would work correctly as it should :-)
"Marcel Hug" <ma**********@ch.abb.com> schrieb im Newsbeitrag
news:eQ****************@TK2MSFTNGP11.phx.gbl...
Hi NG!

In my book I have the following code simple and I tested it:

public class Base : ICloneable
{
public int Age;
public string Name;

public Base(string myname)
{
Name = myname;
}

public Object Clone()
{
return MemberwiseClone();
}

public static void Main(String[] argv)
{
Base myTest = new Base("Joanna");
myTest.Age = 36;
Base clone1 = (Base) myTest.Clone();
Base clone2 = myTest;

bool myBTest = false;
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns true

myBTest = Object.ReferenceEquals(myTest.Age, clone1.Age);
//Book says true
//My Test returns false

myTest.Name = "Julie";
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns false

myBTest = Object.ReferenceEquals(myTest.Name, clone2.Name);
//Book saya true
//my Test returns true
}
}

So I'm a little confused!
With the method MemberwiseClone I do a Shallow copy. That means all value
type would be copied and of the reference types just the pointer in the
variable. Or do i understand this wrong ?

Case 1:
A string is a reference type so it is clear for me, why it results as
true. The pointers points to the same string. Or not ?

Case 2:
Why does this return false ? I guess because a boxing of the to integers
is needed ?

Case 3:
Does this return wrong, because "Julie" could be written as new
String("Julie"); ?

Case 4:
It is clear, because they are two variable which points to the same
instance of the class Base.

Thanks for help!
Regards
Marcel

Mar 31 '06 #2
Marcel,

Look for my answers inline.
In my book I have the following code simple and I tested it:

public class Base : ICloneable
{
public int Age;
public string Name;

public Base(string myname)
{
Name = myname;
}

public Object Clone()
{
return MemberwiseClone();
}

public static void Main(String[] argv)
{
Base myTest = new Base("Joanna");
myTest.Age = 36;
Base clone1 = (Base) myTest.Clone();
Base clone2 = myTest;

bool myBTest = false;
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns true
Book says *true* because it is a shallow copy

myBTest = Object.ReferenceEquals(myTest.Age, clone1.Age);
//Book says true
//My Test returns false
Book says false - boxing happens. You can't get the same object after boxing
even if they have the same value.

myTest.Name = "Julie";
myBTest = Object.ReferenceEquals(myTest.Name, clone1.Name);
//Book says false
//My Test returns false
Correct

myBTest = Object.ReferenceEquals(myTest.Name, clone2.Name);
//Book saya true
//my Test returns true
Correct myTest and clone2 are the same object. }
}

So I'm a little confused!
With the method MemberwiseClone I do a Shallow copy. That means all value
type would be copied and of the reference types just the pointer in the
variable. Or do i understand this wrong ?
This is correct.
Case 1:
A string is a reference type so it is clear for me, why it results as
true. The pointers points to the same string. Or not ?
Yes, you got it right; they point (reference) the same object.

Case 2:
Why does this return false ? I guess because a boxing of the to integers
is needed ?
Yes, ReferenceEquals accept objects, so all value types will be boxed. It
doesn't matter the value of the value type they always will be boxed as
different objects in the heap.
Case 3:
Does this return wrong, because "Julie" could be written as new
String("Julie"); ?
Yes now Julie and Joanna are different objects.
Case 4:
It is clear, because they are two variable which points to the same
instance of the class Base.


Yes, this is the same object in the heap.

Marcel, you get correct results. I don't know, which book(s) you are
refering to, but is seems it/they are not a good one(s)

--
HTH
Stoitcho Goutsev (100)
Mar 31 '06 #3
> if you'd do:

Base clone1 = myTest
Base clone2 = (Base) myTest.Clone();

instead, it would work correctly as it should :-)


Not entirely true. The line

myBTest = Object.ReferenceEquals(myTest.Age,
clone1.Age);

can never return true, as Stoitcho pointed out. Even if you call:

myBTest = Object.ReferenceEquals(5, 5);

it will return false, because both values must be boxed in order to
pass them to ReferenceEquals, and so they will appear as two separate
objects on the heap, with two different addresses. So, there's at least
one mistake in the book. :-)

Mar 31 '06 #4
Bruce Wood <br*******@canada.com> wrote:
if you'd do:

Base clone1 = myTest
Base clone2 = (Base) myTest.Clone();

instead, it would work correctly as it should :-)


Not entirely true. The line

myBTest = Object.ReferenceEquals(myTest.Age,
clone1.Age);

can never return true, as Stoitcho pointed out. Even if you call:

myBTest = Object.ReferenceEquals(5, 5);

it will return false, because both values must be boxed in order to
pass them to ReferenceEquals, and so they will appear as two separate
objects on the heap, with two different addresses. So, there's at least
one mistake in the book. :-)


One interesting thing is that the equivalent code to your last line in
Java 5 (which has autoboxing) *would* return true, at least in Sun's
implementation. It would return true for any number in the range
[-127, 127] - there's a cache of boxed values. Really took me by
surprise when I first saw it...

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 31 '06 #5
I suspected that C# might do something similar, so I tested it before I
posted. Turns out that C# boxes every value individually: the compiler
/ JITter don't notice that 5 could be boxed just once and then the same
reference passed twice.

Mar 31 '06 #6
Bruce Wood <br*******@canada.com> wrote:
I suspected that C# might do something similar, so I tested it before I
posted. Turns out that C# boxes every value individually: the compiler
/ JITter don't notice that 5 could be boxed just once and then the same
reference passed twice.


Fortunately, it's actually documented in the spec:

<quote>
Boxing a value of a value-type consists of allocating an object
instance and copying the value-type value into that instance.
</quote>

(The Java spec specifically says that it *doesn't* necessarily allocate
a new object.)

Admittedly there's one situation (involving strings) where even a
"new" call doesn't actually end up creating a new object, but I think
it's fair to view that as an anomaly :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 31 '06 #7
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Admittedly there's one situation (involving strings) where even a
"new" call doesn't actually end up creating a new object, but I think
it's fair to view that as an anomaly :)


Whaaa? Explain please!

Mar 31 '06 #8
James Park <fa******@fakeaddress.com> wrote:
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Admittedly there's one situation (involving strings) where even a
"new" call doesn't actually end up creating a new object, but I think
it's fair to view that as an anomaly :)


Whaaa? Explain please!


Try this:

using System;

class Test
{
static void Main()
{
string x = new string (new char[]{});
string y = new string (new char[]{});

Console.WriteLine (object.ReferenceEquals (x, y));
}
}

It prints "true" - meaning that x and y are references to the same
object, despite them being the results of "new" expressions.

I believe this is something odd in the string constructor in the .NET
framework, and not a C# thing in itself. It may well give different
results on Mono. Still, I like it as an odd sort of corner case :)

(And no, I have no idea how I discovered it...)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 31 '06 #9

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| James Park <fa******@fakeaddress.com> wrote:
| > "Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
| > news:MP************************@msnews.microsoft.c om...
| > > Admittedly there's one situation (involving strings) where even a
| > > "new" call doesn't actually end up creating a new object, but I think
| > > it's fair to view that as an anomaly :)
| >
| > Whaaa? Explain please!
|
| Try this:
|
| using System;
|
| class Test
| {
| static void Main()
| {
| string x = new string (new char[]{});
| string y = new string (new char[]{});
|
| Console.WriteLine (object.ReferenceEquals (x, y));
| }
| }
|
| It prints "true" - meaning that x and y are references to the same
| object, despite them being the results of "new" expressions.
|

Both x and y are initialzed to an empty string (== String.Empty), which by
itself is an interned string. The result is that x and y are references to
the same string object.
| I believe this is something odd in the string constructor in the .NET
| framework, and not a C# thing in itself. It may well give different
| results on Mono. Still, I like it as an odd sort of corner case :)
|
| (And no, I have no idea how I discovered it...)
|
| --
| Jon Skeet - <sk***@pobox.com>
| http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
| If replying to the group, please do not mail me too

Willy.
Apr 1 '06 #10
Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| It prints "true" - meaning that x and y are references to the same
| object, despite them being the results of "new" expressions.

Both x and y are initialzed to an empty string (== String.Empty), which by
itself is an interned string. The result is that x and y are references to
the same string object.


Yes - but this is the only time it ever happens. You can't create a
reference to any other interned string using "new" - and it actually
violates the spec, which says:

<quote>
The new operator implies creation of an instance of a type
</quote>

In this case, no new instance is being created :(

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 1 '06 #11

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| > | It prints "true" - meaning that x and y are references to the same
| > | object, despite them being the results of "new" expressions.
| >
| > Both x and y are initialzed to an empty string (== String.Empty), which
by
| > itself is an interned string. The result is that x and y are references
to
| > the same string object.
|
| Yes - but this is the only time it ever happens. You can't create a
| reference to any other interned string using "new" - and it actually
| violates the spec, which says:
|
| <quote>
| The new operator implies creation of an instance of a type
| </quote>
|
| In this case, no new instance is being created :(
|

Yes, but all String(Char[]) or String(Char*) constructors are special cases,
take a look at the remark clause(s) in the Framework reference guide.
....
If value is a null reference (Nothing in Visual Basic) or contains no
element, an Empty instance is initialized.
....

On the current version of the CLR, it means that:

string x = String.Empty;
string y = new string (new char[]{});

x and y are references to the same string 'object', but:
- no new instances of String.Empty are ever created, and it's references are
not tracked (like x and y in above)
- the object is not GC heap allocated, it's initialized by the CLR and
shared by all AD's in the process,
Willy.
Apr 1 '06 #12
Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| In this case, no new instance is being created :(

Yes, but all String(Char[]) or String(Char*) constructors are special cases,
take a look at the remark clause(s) in the Framework reference guide.
...
If value is a null reference (Nothing in Visual Basic) or contains no
element, an Empty instance is initialized.
...
I don't think that documentation even makes sense. What is an "Empty
instance" when Empty is a property? It should probably be worded as "a
new object is not created; instead, the value of String.Empty is
returned". Even that's not perfect as constructors initialise an
instance rather than returning it, but it makes more sense than what's
there, IMO...
On the current version of the CLR, it means that:

string x = String.Empty;
string y = new string (new char[]{});

x and y are references to the same string 'object', but:
- no new instances of String.Empty are ever created, and it's references are
not tracked (like x and y in above)


Again, "instances of Sring.Empty" doesn't make sense, as String.Empty
is a property, not a type.

Besides, you can certainly get different instances of System.String
which *are* empty in other ways:

using System;
using System.Text;

class Test
{
static void Main()
{
string x = new StringBuilder().ToString();
string y = new StringBuilder().ToString();
Console.WriteLine (object.ReferenceEquals(x, y));
}
}

Either way, this constructor means that the C# spec is violated - the
"new" operator doesn't return a new instance.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 1 '06 #13

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| > | In this case, no new instance is being created :(
| >
| > Yes, but all String(Char[]) or String(Char*) constructors are special
cases,
| > take a look at the remark clause(s) in the Framework reference guide.
| > ...
| > If value is a null reference (Nothing in Visual Basic) or contains no
| > element, an Empty instance is initialized.
| > ...
|
| I don't think that documentation even makes sense. What is an "Empty
| instance" when Empty is a property? It should probably be worded as "a
| new object is not created; instead, the value of String.Empty is
| returned". Even that's not perfect as constructors initialise an
| instance rather than returning it, but it makes more sense than what's
| there, IMO...
|

Actually, String.Empty is a public static field of type String initialized
to "" by the String .cctor. That means that the first string in an AD
initializes this field to point (a reference) to the interned (process wide)
empty string object.
| > On the current version of the CLR, it means that:
| >
| > string x = String.Empty;
| > string y = new string (new char[]{});
| >
| > x and y are references to the same string 'object', but:
| > - no new instances of String.Empty are ever created, and it's references
are
| > not tracked (like x and y in above)
|
| Again, "instances of Sring.Empty" doesn't make sense, as String.Empty
| is a property, not a type.
|

Sorry I didn't make myself more clear, My point was to show the remark did
not make much sense, that's why I said there is never an 'instance' of an
'Empty' string created by this constructor.

And ...Again, it's a static field of type String.
| Besides, you can certainly get different instances of System.String
| which *are* empty in other ways:
|

Did I say otherwise?

| using System;
| using System.Text;
|
| class Test
| {
| static void Main()
| {
| string x = new StringBuilder().ToString();
| string y = new StringBuilder().ToString();
| Console.WriteLine (object.ReferenceEquals(x, y));
| }
| }
|
| Either way, this constructor means that the C# spec is violated - the
| "new" operator doesn't return a new instance.
|
Let's say, it violates the specs for this particular case (IMO an
optimization with no added value anyway), IMO it's the C# the spec which is
too strict, string objects are so special it should mention this as an
exceptions.
Willy.


Apr 1 '06 #14
Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| I don't think that documentation even makes sense. What is an "Empty
| instance" when Empty is a property? It should probably be worded as "a
| new object is not created; instead, the value of String.Empty is
| returned". Even that's not perfect as constructors initialise an
| instance rather than returning it, but it makes more sense than what's
| there, IMO...

Actually, String.Empty is a public static field of type String initialized
to "" by the String .cctor. That means that the first string in an AD
initializes this field to point (a reference) to the interned (process wide)
empty string object.
Apologies, yes. It's still not a type though, so I don't think that it
makes sense to talk about an instance of it :)
| Again, "instances of Sring.Empty" doesn't make sense, as String.Empty
| is a property, not a type.

Sorry I didn't make myself more clear, My point was to show the remark did
not make much sense, that's why I said there is never an 'instance' of an
'Empty' string created by this constructor.
Right.
| Besides, you can certainly get different instances of System.String
| which *are* empty in other ways:
|

Did I say otherwise?
I think I misinterpreted this line:

<quote>
no new instances of String.Empty are ever created,
</quote>

I thought you meant "in general" (given the word "ever") rather than
"with the code above".
| Either way, this constructor means that the C# spec is violated - the
| "new" operator doesn't return a new instance.

Let's say, it violates the specs for this particular case (IMO an
optimization with no added value anyway), IMO it's the C# the spec which is
too strict, string objects are so special it should mention this as an
exceptions.


I'm not sure - as you say, the optimization doesn't provide much value,
and I think it's entirely reasonable that "new" should mean *new*.

My guess is that the CLR is violating its spec as well - from partition
III of the ECMA spec (2nd edition, Dec 2002):

<quote>
The newobj instruction creates a new object or a new instance of a
value type.
</quote>

Now, the C# code generates a newobj instruction, but the CLR is *not*
creating a new object.

I would make more of a fuss about this, but I suspect any code that it
actually breaks is pretty poorly written to start with!

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 1 '06 #15

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| > | I don't think that documentation even makes sense. What is an "Empty
| > | instance" when Empty is a property? It should probably be worded as "a
| > | new object is not created; instead, the value of String.Empty is
| > | returned". Even that's not perfect as constructors initialise an
| > | instance rather than returning it, but it makes more sense than what's
| > | there, IMO...
| >
| > Actually, String.Empty is a public static field of type String
initialized
| > to "" by the String .cctor. That means that the first string in an AD
| > initializes this field to point (a reference) to the interned (process
wide)
| > empty string object.
|
| Apologies, yes. It's still not a type though, so I don't think that it
| makes sense to talk about an instance of it :)
|

Agreed, the "Remarks" clause is incorrect, well, let's say badly worded.

| > | Again, "instances of Sring.Empty" doesn't make sense, as String.Empty
| > | is a property, not a type.
| >
| > Sorry I didn't make myself more clear, My point was to show the remark
did
| > not make much sense, that's why I said there is never an 'instance' of
an
| > 'Empty' string created by this constructor.
|
| Right.
|
| > | Besides, you can certainly get different instances of System.String
| > | which *are* empty in other ways:
| > |
| >
| > Did I say otherwise?
|
| I think I misinterpreted this line:
|
| <quote>
| no new instances of String.Empty are ever created,
| </quote>
|
| I thought you meant "in general" (given the word "ever") rather than
| "with the code above".
|

No, sorry I meant using the String constructors taking the char[] or char*
as argument.

| > | Either way, this constructor means that the C# spec is violated - the
| > | "new" operator doesn't return a new instance.
| >
| > Let's say, it violates the specs for this particular case (IMO an
| > optimization with no added value anyway), IMO it's the C# the spec which
is
| > too strict, string objects are so special it should mention this as an
| > exceptions.
|
| I'm not sure - as you say, the optimization doesn't provide much value,
| and I think it's entirely reasonable that "new" should mean *new*.
|
| My guess is that the CLR is violating its spec as well - from partition
| III of the ECMA spec (2nd edition, Dec 2002):
|
| <quote>
| The newobj instruction creates a new object or a new instance of a
| value type.
| </quote>
|
| Now, the C# code generates a newobj instruction, but the CLR is *not*
| creating a new object.
|
True.

| I would make more of a fuss about this, but I suspect any code that it
| actually breaks is pretty poorly written to start with!
|
True, but that doesn't mean that the Remarks clause couldn't be changed into
something that clearly describes the exact behavior when the constructor
takes an empty char array or null, and that it's preferable to use
String.Empty to get an 'empty' string reference.

Willy.


Apr 1 '06 #16
Willy Denoyette [MVP] <wi*************@telenet.be> wrote:

<snip lots of agreements>
| I would make more of a fuss about this, but I suspect any code that it
| actually breaks is pretty poorly written to start with!

True, but that doesn't mean that the Remarks clause couldn't be changed into
something that clearly describes the exact behavior when the constructor
takes an empty char array or null, and that it's preferable to use
String.Empty to get an 'empty' string reference.


Yup. Do you want to put it in the feedback centre or shall I? ;)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 1 '06 #17
> Not entirely true. The line

myBTest = Object.ReferenceEquals(myTest.Age,
clone1.Age);

can never return true, as Stoitcho pointed out. Even if you call:

myBTest = Object.ReferenceEquals(5, 5);

it will return false, because both values must be boxed in order to
pass them to ReferenceEquals, and so they will appear as two separate
objects on the heap, with two different addresses. So, there's at least
one mistake in the book. :-)


Oh sure, I misread the lines

Base clone1 = (Base) myTest.Clone();
Base clone2 = myTest;

as

Base clone1 = (Base) myTest.Clone();
Base clone2 = clone1;

:)
Apr 3 '06 #18

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
|
| <snip lots of agreements>
|
| > | I would make more of a fuss about this, but I suspect any code that it
| > | actually breaks is pretty poorly written to start with!
| >
| > True, but that doesn't mean that the Remarks clause couldn't be changed
into
| > something that clearly describes the exact behavior when the constructor
| > takes an empty char array or null, and that it's preferable to use
| > String.Empty to get an 'empty' string reference.
|
| Yup. Do you want to put it in the feedback centre or shall I? ;)
|
|

Just do it Jon if you will, I will vote for it.

Willy.
Apr 4 '06 #19
Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| Yup. Do you want to put it in the feedback centre or shall I? ;)

Just do it Jon if you will, I will vote for it.


Have done so at

http://lab.msdn.microsoft.com/Produc...Feedback.aspx?
feedbackId=FDBK48357

Feel free to express the problem better :)

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Apr 6 '06 #20

"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
| Willy Denoyette [MVP] <wi*************@telenet.be> wrote:
| > | Yup. Do you want to put it in the feedback centre or shall I? ;)
| >
| > Just do it Jon if you will, I will vote for it.
|
| Have done so at
|
| http://lab.msdn.microsoft.com/Produc...Feedback.aspx?
| feedbackId=FDBK48357
|

Great, voted.

| Feel free to express the problem better :)
|

I don't see any need for it at the moment, I'll wait for their feedback.
Willy.
Apr 7 '06 #21

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

Similar topics

1
by: Holbox | last post by:
Hi people, look at this (console project) sub main dim a as string = "Hola" dim b as string = "Hola" dim c as string = new string("Hola") dim d as string = new string("Hola")
2
by: Kevin B Ebert | last post by:
Today, I ran into something I didn't quite expect. I'm sure there is a logical explanation for it so I want to post it and see if anyone can explain the difference to me. I came across a...
6
by: Daniel Billingsley | last post by:
In C# these are equivalent, right? if (ReferenceEquals(objectA, objectB)) { } and if (objectA == objectB) {
3
by: Fei Li | last post by:
Hi, take string class as an example, who can explain the difference? Thanks
4
by: Kiran A K | last post by:
hi, consider the following piece of code: string s1 = "kiran"; string s3 = s1.Clone() as string; Console.WriteLine(System.Object.ReferenceEquals(s1, s3)); The above piece of code gave me...
5
by: Marcel Hug | last post by:
Hi NG ! I'm new in C# and I'm reading a book about the fundamentals and concepts. In the chapter Methods it's written to use virtual, if i would like to override the method in a subclass. This...
2
by: Marcel Hug | last post by:
Hi Ng ! At first I would like to thank you about the very good answers on my C# Fundamental question one. Now I have a new question. It's about structs. So I've read that the different between...
10
by: Bruce | last post by:
I posted this on the dotnet.languages.vc group but did not get a response. I figure that I could apply what I learn from CSharp to VC, so here goes. I have a class in a class assembly, that...
2
by: situ | last post by:
Hi, i took db2 fundamentals 730 exam on Dec-06 in one of the prometric centers, and succesfully passed also. but the problem is i didn't got my certificate yet, usually how long it takes to...
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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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.