I have no practical need for this, but I was wondering:
is there anyway in C# to know, for any two arbitrary objects, which one was created first?
No. Unless the object has a read-only property that stored the date and time that the object was created, there's no way to know.
Only if, inside the constructor of the object, you store the current date/time (note that DateTime.Now
almost certainly has insufficient precision to be useful) and provide some means of exposing that information publicly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With