aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Green Constructor Q doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus Green Constructor Q doubt?" Watch "Marcus Green Constructor Q doubt?" New topic
Author

Marcus Green Constructor Q doubt?

Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
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,


"The man who can drive himself further once the effort gets painful is the man who will win." <br />Roger Bannister
Vicken Karaoghlanian
Ranch Hand

Joined: Jul 21, 2003
Posts: 522
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.


- Do not try and bend the spoon. That's impossible. Instead, only try to realize the truth. <br />- What truth? <br />- That there is no spoon!!!
Vishy Karl
Ranch Hand

Joined: Sep 08, 2003
Posts: 116
Thanks Vicken,
Got it ,
bye,
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Marcus Green Constructor Q doubt?
 
Similar Threads
Question on Construtor
constructor concepts...
A question on constructor
Mock Question