Member • Jun 4, 2015
-
Amanneoif constructor is a instance method then how it gets called in a static context which is a main method.....how is it possible????? i have a lot of confusion about this topic...i am not getting rid of this confudion....can nyone help me out????
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Member • Jun 7, 2015
#-Link-Snipped-# Can you elaborate you question with an exampleAre you sure? This action cannot be undone. -
Member • Jun 8, 2015
A constructor is defined and not called when you run the program (i.e main method gets called).
A constructor is called only when you create an object of a class.
I'll brush up on my basics and provide you a proper answer here in a bit.Are you sure? This action cannot be undone. -
Member • Jun 9, 2015
The constructor is "invoked" and not explicitly called when an object is created. I believe that is the only reason a static function, Main(), can allow an implicit call to the constructor.Are you sure? This action cannot be undone.