This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of Abstract Interfaces

 
Java Programmer
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When will we use abstract interfaces and how ? pls. help me out
& Why interfaces cannot be instantiated ? are abstract classes instantiated ?
Do tell with good examples
 
Tim West
Ranch Hand
Posts: 539
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting, a very similar topic was discussed in this forum not-so-long ago, here.
I'd look at Bruce Eckel's Thinking In Java for excellent discussion and examples.
If I were you, I'd also consider reading this.
--Tim
[ April 22, 2004: Message edited by: Tim West ]
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First thing that Interface are always abstrat and can't be instantiated because they only declare methods in it not define them thats why they can't get instantiated same is for abstract class that it might 1 or more methods which it doesn't implement or define thats why we can't make object of abstract classes too.
Both are very useful at different places. I think you don't have the idea of polymorphism and inheritance thats why you asked that question. Do read these concepts and it will be clear.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic