http://www.java2s.com/Tutorial/CSharp/0120__struct/Usethistoreferencestructsconstructor.htm
In the 2nd constructor, this is used. Can anyone please explain what’s going on there?
Thanks!
http://www.java2s.com/Tutorial/CSharp/0120__struct/Usethistoreferencestructsconstructor.htm
In the 2nd constructor, this is used. Can anyone please explain what’s going on there?
Thanks!
Function Overloading. You can create an instance of the class with either one parameter, or two since it is being defined there. In their example they used two, but they could have used one and not received an error. Search for function overloading and it should explain much better than me.
Sorry, I wasn’t very clear. I meant what’s going on here:
public ComplexNumber( double real ):this( real, 0 )
What is “: this” doing after the function definition?
Thanks!
:: Copyright KIRUPA 2024 //--