Originally posted by JosAH
Java classes comments
Collapse
X
-
hi r035198x/Jos,Originally posted by r035198xAnd I've just moved from Vista to Fedora as well (Not that I'm complaining about the move of course).
One question is still there to be answered....Wha t is contructors doing in abstract class if we cant create object of that.....sugges t me on that one....plzz
Thanks and regard,
madhoriyaComment
-
You may not be able to create an instance from an abstract class, you may beOriginally posted by madhoriya22hi r035198x/Jos,
One question is still there to be answered....Wha t is contructors doing in abstract class if we cant create object of that.....sugges t me on that one....plzz
Thanks and regard,
madhoriya
very well able to instantiate an object from a concrete subclass. A class
constructor always (implicitly) calls its superclass' constructor so an abstract
class needs at least one constructor as well.
kind regards,
JosComment
-
Remember that you can call a constructor in an immediate superclass using the super keyword. So basically a constructor in an abstract class is invoked from extending classes' constructors. Note that public constructors in abstract class are not needed since only extending classes can access themOriginally posted by madhoriya22hi r035198x/Jos,
One question is still there to be answered....Wha t is contructors doing in abstract class if we cant create object of that.....sugges t me on that one....plzz
Thanks and regard,
madhoriyaComment
-
Thanks for ur suggestions.... ..but still I am trying to understand it......I vil catch u later... If I have another doubts.Originally posted by r035198xRemember that you can call a constructor in an immediate superclass using the super keyword. So basically a constructor in an abstract class is invoked from extending classes' constructors. Note that public constructors in abstract class are not needed since only extending classes can access them
What happen to more discussions in free java classes.....eag erly waiting for that....
Thanks and regards,
madhoriyaComment
-
Yeah, maybe I'll add a few more things in there soon, or better still use delegation.Originally posted by madhoriya22Thanks for ur suggestions.... ..but still I am trying to understand it......I vil catch u later... If I have another doubts.
What happen to more discussions in free java classes.....eag erly waiting for that....
Thanks and regards,
madhoriyaComment
Comment