Link to home
Start Free TrialLog in
Avatar of IzzyTwinkly
IzzyTwinklyFlag for United States of America

asked on

what does 'this' do?

From the code below, I don't know why 'this' has been used in the method since the result is the same without it.  I've always told that 'this' means 'current object'.  Is it still a case here?  What is the current obejct here?  Why would we use 'this' here?

public int[] copyArray(int[] source)
{
        this.des = new int[source.Length];
        for (int i = 0; i < source.Length; i++)
            this.des[i] = source[i];
        return this.des;
}
ASKER CERTIFIED SOLUTION
Avatar of CuteBug
CuteBug
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial