Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
I've understood interfaces are rather used to help developers maintain the classes, they offer good view for developers to check what methods a class should have, class self it can look like: class NewMath { public static double sin(double x) { //100 lines of code } public static double sqrt(double x) { //Another 100 lines of code } } But interface: interface NewMath { public double sin(double x); public double sqrt(double x); } It makes it easier for developer to check what member do a class have.
25th Jan 2020, 10:12 PM
Seb TheS
Seb TheS - avatar