none
== operator does check value or reference RRS feed

  • Question

  • 1)

    we often use == operator but i like to know does it check value or reference

    int x =1;

    int y =1;

    if(x==y) return true in this case i believe == operator check value ? am i right?

    2) in case of string 

    string x ="Hello";

    string y = "Hello";

    if(x==y) return true in this case i believe == operator check value ? am i right?

    in case of string == operator check value or reference ?

    how to check reference of two string variables or two class instance ?

    thanks

    Tuesday, April 3, 2018 12:21 PM

Answers

All replies