Java Programming - Declarations and Access Control - Discussion
Discussion Forum : Declarations and Access Control - Pointing out the correct statements (Q.No. 5)
5.
class A
{
A( ) { }
}
class B extends A
{ }
Which statement is true?Answer: Option
Explanation:
Option B is correct. Class B inherits Class A's constructor which has no arguments.
Option A is wrong. Class B inherits Class A's constructor which uses default access.
Option C is wrong. There is just no implicit call to this( ).
Discussion:
11 comments Page 2 of 2.
Raja Mahesh Aravapalli said:
1 decade ago
I observed in SCJP 6 by kathy sierra and bert bates, that constructors will not be inherited from super class.
Could you please clarify ?
Could you please clarify ?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers