r/learnjava • • Nov 29 '25

Can someone Please Help me understand INTERFACES and exactly why need them?

I get the point of Multiple Inheritance but not the "WHY" behind achieving 100% Abstraction for the methods. Confused in Tight and Loose Coupling as well. Sometimes I feel I understand, the next moment again confused :) I need this information because I have started LLD, LLD needs Abstraction ... I know all of OOP Concepts of Java but interfaces always confuse me.

Thank you.

32 Upvotes

30 comments sorted by

View all comments

Show parent comment

3

u/Sonu_64 Nov 30 '25

So the methods are actually Abstract to the interface itself right ? That's how abstraction is achieved?

3

u/milkybuet Nov 30 '25

Yes.

The get() method in WebDriver for example, it'll look something like this,

void get(String url);

There's not gonna be any body there. In ChromeDriver it'll look something like this,

@Override
void get(String url) {
    // Chrome specific get() implementation
}

And similarly in GeckoDriver,

@Override
void get(String url) {
    // Firefox specific get() implementation
}