Whats the point if you need to override all the methods insde the interface ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Whats the point if you need to override all the methods insde the interface ?

9th Jan 2016, 3:23 AM
Kanon
Kanon - avatar
2 Answers
+ 1
it defines the things the new class needs to have. it's great for making sure things conform to standards. you can use an interface to implement an API or way of communicating. this way, if you know a class implements the interface "CRUD" for example, and you define the CRUD interface to have 4 methods: Create, Read, Update, Delete, well now, you know any class that implements your CRUD interface will have the proper methods you want it to. Now the compiler can check and make sure you did what you meant to do.
9th Jan 2016, 8:02 AM
Nick Steele
Nick Steele - avatar
0
This is the gentleman agreement between interface and implemented classes, we have to provide basic needs for the classes, This like satisfying govt rules on private firms using their own capacity, like if you want to use my services you have to follow my rules..
30th Mar 2016, 11:04 AM
Vinoth Raj Radhakrishnan