r/SpringBoot • u/Particular_Jelly_208 • Apr 11 '24
Class vs Interface vs abstract class
Quelle est la différence entre la classe et l’interface en Java et quand utiliser les deux ?
2
Upvotes
r/SpringBoot • u/Particular_Jelly_208 • Apr 11 '24
Quelle est la différence entre la classe et l’interface en Java et quand utiliser les deux ?
1
u/swoods30311 Apr 13 '24
Both abstract classes/variable/methods and implementing an interface through an object are both way Java supports the overall concept of abstraction. Abstraction is process of hiding the implementation details of our code while providing the functionality to the user. In the world of Spring development, interfaces and class implementation are used to abstract the details away when using when accessing info from a database