Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abtract class object is not created

 
Pramod P Deore
Ranch Hand
Posts: 632
Android Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if we extends the abstract class and provide the implementation for the methods which are declared in abstract class.And then we create the object of that subclass. then at that time default constructor of that subclass is called and we pass 'super' in the constructor of that subclass then it call the constructor of super class? is there is any object create of abstract class?
 
Sagar Rohankar
Ranch Hand
Posts: 2905
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pramod deodeore:
if we extends the abstract class and provide the implementation for the methods which are declared in abstract class.And then we create the object of that subclass. then at that time default constructor of that subclass is called and we pass 'super' in the constructor of that subclass then it call the constructor of super class? is there is any object create of abstract class?


What you explain is correct, but there is no object created for abstract class. Constructors are made to initialize the instance variable, though of that base abstract class too..
 
Campbell Ritchie
Sheriff
Pie
Posts: 47258
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The way I think of it, which might not be accurate, is that every object has a "part" which is inherited from its superclass. So every object has a toString() method inherited from java.lang.Object.
The super() call (explicit or implicit) sets up that "part."
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic