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
Smiling on Java
Joined: Mar 15, 2004
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 ]
Joined: Mar 18, 2004
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.