+ 3
What is difference between interface and abstract class?
2 Réponses
+ 4
Hello, Maninder Singh !
Please use the search feature on SoloLearn, I think this is a good opportunity. Also this will help prevent duplication of posts.
You can also read the rules for "creating content" on SoloLearn.
https://www.sololearn.com/Content-Creation-Guidelines
Good luck in programming on SoloLearn!
https://www.sololearn.com/Discuss/489391/?ref=app
https://www.sololearn.com/Discuss/363907/?ref=app
+ 1
Interfaces are rules (provides only method declarations and not the implementation). Interfaces give the idea what is to be done but not how it will be done. So implementation completely depends on developer by following the given rules (means given signature of methods).
Abstract classes may contain abstract declarations, concrete implementations, or both. But interfaces cannot have concrete implementations. Abstract declarations are like rules to be followed and concrete implementations are like guidelines (you can use it as it is or you can ignore it by overriding and giving your own implementation to it).
You can see in detail here:- http://crbtech.in/Java-Training/explain-difference-detween-interface-abstract-class/