Vote Up 0 Vote Down

what is interface and uses of interface

Will anybody elaborate me about this, "implements Interface" and also what is interface and uses of interface
flag

Answers


Vote Up 0 Vote Down
Interface is a group of related methods with empty bodies to specify an object behaviour
Ex:

 interface Bicycle {

// wheel revolutions per minute
void changeCadence(int newValue);

void changeGear(int newValue);

void speedUp(int increment);

void applyBrakes(int decrement);
}


To implements this interface, we use implements keyword in the class declaration
flag | link |
Vote Up 0 Vote Down
interface generally work like a mediator... which actually work is to communicate b/w two body....
flag | link |

Your Answer

Login before answering

Login with facebook