Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance Variable In abstarct classes

 
Punya Pratap Singh
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Interfaces can have only constents cuz they can not be instantiated so why Abstract Classes can have Instance Variables as they also can not be Instantiated.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Punya Pratap Singh wrote:As Interfaces can have only constents cuz they can not be instantiated so why Abstract Classes can have Instance Variables as they also can not be Instantiated.


There is a lot of difference between Interfaces and Abstract Classes. You can read about why Interfaces and Abstract classes are used.
 
Punya Pratap Singh
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..As for as I know both are used for achiving Abstraction and Ploymorphism,Can you Provide me any link where I could get the matrial related to my Question.
 
Mohamed Sanaulla
Saloon Keeper
Posts: 3159
33
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Punya Pratap Singh wrote:Thanks..As for as I know both are used for achiving Abstraction and Ploymorphism,Can you Provide me any link where I could get the matrial related to my Question.


This might give you some information: http://www.javaworld.com/javaworld/javaqa/2001-04/03-qa-0420-abstract.html

 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

Please beware of misspellings; it's not "cuz", please.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic