Click here to Skip to main content
15,895,667 members
Home / Discussions / C#
   

C#

 
GeneralRe: Not sure how it fits BUT Pin
Pete O'Hanlon9-Nov-06 4:20
mvePete O'Hanlon9-Nov-06 4:20 
QuestionThreading Conversion Pin
eatwork8-Nov-06 4:17
eatwork8-Nov-06 4:17 
AnswerRe: Threading Conversion Pin
led mike8-Nov-06 5:30
led mike8-Nov-06 5:30 
GeneralRe: Threading Conversion Pin
eatwork8-Nov-06 12:24
eatwork8-Nov-06 12:24 
QuestionI want a prettier application Pin
lsugirljte8-Nov-06 3:43
lsugirljte8-Nov-06 3:43 
AnswerRe: I want a prettier application Pin
Pete O'Hanlon8-Nov-06 4:19
mvePete O'Hanlon8-Nov-06 4:19 
AnswerRe: I want a prettier application Pin
Just me at will_george...something8-Nov-06 4:27
Just me at will_george...something8-Nov-06 4:27 
QuestionSemantics of Object.Equals(object) Pin
Goebel8-Nov-06 3:03
Goebel8-Nov-06 3:03 
Hello,

I've just come across the Equals() method and I'm not sure about its correct semantics. Let me clarify with an example:

<br />
public class Tester<br />
{<br />
  public int a; <br />
  public int b; <br />
  public int c; <br />
<br />
  public Tester(int a, int b, int c)<br />
  {<br />
    this.a = a; <br />
    this.b = b; <br />
    this.c = c; <br />
  }<br />
  <br />
  public override bool Equals(object obj)<br />
  {<br />
    if (this.GetType() == obj.GetType())<br />
    {<br />
      Test test = obj as Test; <br />
      <br />
      if ((this.a == test.a) && (this.b == test.b))<br />
	return true; <br />
      else<br />
        return false; <br />
     }<br />
     else<br />
       return false; <br />
  }<br />
} <br />


Two objects of class Tester shall be equal if members int a, int b are equal - independent of int c. The content is being checked, not references. May I actually do this or are there any concerns?

Thanks for your help,
Goebel
AnswerRe: Semantics of Object.Equals(object) Pin
led mike8-Nov-06 5:24
led mike8-Nov-06 5:24 
AnswerRe: Semantics of Object.Equals(object) Pin
Scott Dorman8-Nov-06 7:16
professionalScott Dorman8-Nov-06 7:16 
GeneralRe: Semantics of Object.Equals(object) Pin
Goebel22-Nov-06 4:49
Goebel22-Nov-06 4:49 
Questionpopulate word document Pin
mian ghous8-Nov-06 2:48
mian ghous8-Nov-06 2:48 
AnswerRe: Creating a generic item dynamically Pin
Stefan Troschuetz8-Nov-06 4:07
Stefan Troschuetz8-Nov-06 4:07 
GeneralRe: Creating a generic item dynamically Pin
Ista8-Nov-06 11:52
Ista8-Nov-06 11:52 
GeneralRe: Creating a generic item dynamically Pin
mian ghous10-Nov-06 0:06
mian ghous10-Nov-06 0:06 
Questionmp3 tags. Pin
ToddHileHoffer8-Nov-06 2:09
ToddHileHoffer8-Nov-06 2:09 
AnswerRe: mp3 tags. Pin
Ista8-Nov-06 11:55
Ista8-Nov-06 11:55 
QuestionNewbie: How to detect if an item in a DB record is null (mysql)... Pin
Phillip Hodges8-Nov-06 2:06
Phillip Hodges8-Nov-06 2:06 
AnswerRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
_mubashir8-Nov-06 2:26
_mubashir8-Nov-06 2:26 
GeneralRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
Phillip Hodges8-Nov-06 2:32
Phillip Hodges8-Nov-06 2:32 
GeneralRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
Guffa8-Nov-06 2:41
Guffa8-Nov-06 2:41 
GeneralRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
Phillip Hodges8-Nov-06 3:03
Phillip Hodges8-Nov-06 3:03 
GeneralRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
Guffa8-Nov-06 22:50
Guffa8-Nov-06 22:50 
AnswerRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
ednrgc8-Nov-06 2:47
ednrgc8-Nov-06 2:47 
AnswerRe: Newbie: How to detect if an item in a DB record is null (mysql)... Pin
V.8-Nov-06 3:01
professionalV.8-Nov-06 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.