• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Marcus Green Constructor Q doubt?

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Vicken,
Got it ,
bye,
 
reply
    Bookmark Topic Watch Topic
  • New Topic