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.
Aditya said:
1 decade ago
constructors are NOT inherited in subclass....
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers