What is the difference between implements and extends

0 votes

When should we use implements and when to use extends in Java?

Apr 20, 2018 in Java by anonymous
16,353 views

2 answers to this question.

0 votes

extends is used by a class for extending any other class. Also used by an interface to implement any other interface.

implements is by a class for implementing an interface

answered Apr 20, 2018 by Daisy
• 8,140 points
0 votes

Extends : This is used to get attributes of a parent class into base class and may contain already defined methods that can be overridden in the child class.

Implements : This is used to implement an interface (parent class with functions signatures only but not their definitions) by defining it in the child class.

There is one special condition: "What if I want a new Interface to be the child of an existing interface?". In the above condition, the child interface extends the parent interface.

answered Aug 3, 2018 by samarth295
• 2,220 points

Related Questions In Java

0 votes
1 answer

What is the difference between Runnable and extends Thread

Runnable is the preferred way to create ...READ MORE

answered May 1, 2018 in Java by sharth
• 3,370 points
1,196 views
0 votes
1 answer

What is the difference between jdk and jre?

JRE: It stands for Java Runtime Environment. ...READ MORE

answered Apr 20, 2018 in Java by Akrati
• 3,190 points
2,012 views
0 votes
2 answers

What is the difference between Set and List in java?

List is an ordered sequence of elements. ...READ MORE

answered Apr 26, 2018 in Java by Akrati
• 3,190 points
63,405 views
0 votes
1 answer

What is the difference between Polymorphism, Overriding and Overloading?

As far as I know, the main ...READ MORE

answered Jun 19, 2018 in Java by scarlett
• 1,290 points
12,038 views
0 votes
1 answer

Implements vs extends: When to use? What's the difference?

Extends is for extending a class. implements are for implementing an interface The difference between ...READ MORE

answered Dec 30, 2020 in Java by Gitika
• 65,770 points
2,008 views
0 votes
1 answer

using comparator for sorting in java

You've got two problems: 1) You're using Collections.sort (which takes ...READ MORE

answered Jul 6, 2018 in Java by samarth295
• 2,220 points
814 views
+1 vote
2 answers

Retrieve all the implementations of an interface in Java

Take a look to this example: https://github.com/burningwave/co ...READ MORE

answered Dec 21, 2019 in Java by Roberto
• 460 points

edited Jul 7, 2020 by Roberto 38,647 views
0 votes
1 answer

Usage of abstract class and interface

Well let me draw a clear line ...READ MORE

answered Oct 23, 2018 in Java by geek.erkami
• 2,680 points
744 views
0 votes
2 answers

What is the difference between = and equals()?

The equals() method compares the "value" inside String instances ...READ MORE

answered Aug 13, 2018 in Java by Daisy
• 8,140 points
1,429 views
+1 vote
1 answer

What is the difference between JavaScript and Java

This quote rightly explains that 2 totally ...READ MORE

answered Jun 29, 2018 in Java by Daisy
• 8,140 points
801 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP