Online visitors

People learning around the world

Online

—

Visitors exploring W3Schools

Online visitors by country Circles show approximate country locations. The country list provides the visitor counts.

Circles represent countries, not exact visitor locations.

Country

Online

Loading country activity…

    What is the Difference Between Abstract Class and Interface in Java?

    Both abstract class and interface are the major components of the Java language. Both these techniques are used for hiding the implementing part and exposing the functionality part of a program to its users. But both of these are different from one another:

    Abstract Class Interface
    Only a single abstract class be get inherited by a class. A class can inherit several interfaces.
    An abstract class provides the complete code or simply the details which need to be overridden. The interface provides the signature rather than the code.
    It is comparatively faster than the interface. It requires more execution time and hence slower than an abstract class.
    There you can provide the access specifier to the functions and properties of the abstract class. There cannot be any access specifier to the interface, and hence everything is taken as a public.
    You can define fields and constants for abstract class. You cannot define any fields within the interface.


    Found This Page Useful? Share It!
    Get the Latest Tutorials and Updates
    Join us on Telegram

    Notifications

    Updates are enabled for this browser.

    Receive new tutorials, articles and learning resources. You can turn updates off anytime.