• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Marcus Green Constructor Q doubt?

 
Vishy Karl
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Following Q appears in Marcus Green Exam,

The Correct Answer is
4) A call to a constructor in a parent class can only be made from within a constructor.
A constructor can be declared as private. Although the default constructor takes no arguments, creating a no args constructor does not make it the default constructor. Overloading constructors is a very common programming technique.
I cannot understand why B is false ?? Why does creating a no args constructor does not make it the default constructor ???

Thanks in Advance,
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Vishy,
The default constructor is created implicitly by the compiler. When you create any constructor (with or without arguments), you are actually telling the compiler not to create the default constructor. Creating a constructor with no args DOES NOT make that constructor the default.
The default is only created by the compiler and not by the programmer.
Hope this helps.
 
Vishy Karl
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vicken,
Got it ,
bye,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic