Hi all,
for the below code:
class A{ }
class B extends A{ }
why we extends 'A' class to inherit the properties in 'B'?
Here we can use,
class B{
A a = new A();//to get properties of 'A' class
}
why should we go for inheritance by using 'extends' keyword to inherit?
Please help me out in this concept. Thanks in advance.
surya55 0 Newbie Poster
Taywin 312 Posting Virtuoso
stultuske 1,116 Posting Maven Featured Poster
Slavi 94 Master Poster Featured Poster
stultuske 1,116 Posting Maven Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.