Meaningless Drivel is fun!*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 3064
    
  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: 3064
    
  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: 37900
    
  22
Welcome to the Ranch

Please beware of misspellings; it's not "cuz", please.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Instance Variable In abstarct classes
 
Similar Threads
About interface
Abstract
Static member class question
Interface
Abstract Classes