Reason behind calling a constructor in main function wich a static method..

if 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????

Replies

  • micheal john
    micheal john
    #-Link-Snipped-# Can you elaborate you question with an example
  • Phenomenal
    Phenomenal
    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.
  • Shashank Moghe
    Shashank Moghe
    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.

You are reading an archived discussion.

Related Posts

The local smartphone maker, Micromax has announced the launch of its mid-range smartphone called ‘Micromax Canvas Knight 2’. Priced at Rs. 16,299, the new 4G LTE -enabled dual SIM (both...
Vu has announced a new 60" full HD LED TV LED60S8575 in India with a price tag of Rs. 92,000. The TV boasts of impressive hardware A+ grade achromatic panel...
Can anyone suggest some thesis ideas that relates digital forensics and malware analysis? (Something that combines malware detection in a digital forensic scenario)
Hi Kaustubh, I got job through campus placement. I joined, in my current company, as a fresher. At first i was given some basic training about SQL programming for around...
After unveiling two low-budget smartphones- Aqua 3G Pro and 3G Strong just a couple of days ago, Intex Technologies has listed its first 4G LTE-enabled smartphone called ‘Intex Aqua 4G+’...