This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes abtract class object is not created Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "abtract class object is not created" Watch "abtract class object is not created" New topic
Author

abtract class object is not created

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

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?


Life is easy because we write the source code.....
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

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..


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
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."
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: abtract class object is not created