aspose file tools*
The moose likes Java in General and the fly likes Instance Variable In abstarct classes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Instance Variable In abstarct classes" Watch "Instance Variable In abstarct classes" New topic
Author

Instance Variable In abstarct classes

Punya Pratap Singh
Ranch Hand

Joined: Nov 23, 2010
Posts: 80
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

Joined: Sep 08, 2007
Posts: 3071
    
  33

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.


Mohamed Sanaulla | My Blog
Punya Pratap Singh
Ranch Hand

Joined: Nov 23, 2010
Posts: 80
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

Joined: Sep 08, 2007
Posts: 3071
    
  33

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

Joined: Oct 13, 2005
Posts: 38902
    
  23
Welcome to the Ranch

Please beware of misspellings; it's not "cuz", please.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Instance Variable In abstarct classes