Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Please don't be annoyed, but I have pulled rank and changed your answer.We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Sachin Tripathi wrote:Avoid using parent and child for super and sub classes,because they have no resemblance to parent or child
The rule about which you are talking about:
Instance(object) of subclass can be assigned to reference variable of its super class (direct or indirect)
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Sankalp Bhagat wrote:LMAO
The very first thing, parent class for superclass and child class for subclass I've taken for better understanding. And by the way I've already used A is superclass of B and C.
Sachin Tripathi wrote:First of all ,we expect everyone to not to use abbreviations (LMAO,gotta)
Reason:we are here to simplify things,using such acronyms, abbreviation, slang (whatever they are)won't help our cause
Anything which you feel to be helpful won't be helpful until that is right
So you are not advised to use parent and child
A-superclass
B-subclass
A a=new B();
What will this do
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Trying to collect the broken pieces of my life,in the process of making out a beautiful picture out of it.
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
|