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
352 views

2 answers to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,020 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,190 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 Apr 30, 2018 in Java by sharth
• 3,310 points
64 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,150 points
72 views
0 votes
1 answer

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,150 points
28 views
0 votes
1 answer
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,190 points
37 views
0 votes
1 answer

Retrieve all the implementations of an interface in Java

Hi...I think you can achieve this by ...READ MORE

answered Jul 23, 2018 in Java by anto.trigg4
• 3,420 points
118 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,320 points
54 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,020 points
25 views
0 votes
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,020 points
19 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.