Resolved Create objects without a constructor

aaaron

Well-known member
Joined
Jan 23, 2011
Messages
219
Programming Experience
10+
Looking at a recent post I noticed that a Process object seems to be used (created) without calling a constructor.

Thinking about it I realized I've been doing the same things with Strings.

That is, creating an object (pointed to by a reference variable) by simply assignment.

I've been searching the internet using terms like "no constructor" but get no relevant hits.

I understand composing a complete tutorial relative to the above is most likely more time consuming than I have the right to expect, but I'm hoping for a few words that might simply help me understand and point me so I can better investigate on my own.
 
It is not possible to create an instance without using the New keyword to invoke the constructor. A method can create an instance and return that to you. It is also possible with conversion operators that create an instance from a different type of object.
 
So Process.Start, which is Shared so it ca be called directly, runs New an returns the object?

Not that I have the need, but could I do that in one f my classes?

Thanks
 
Back
Top