GoConqr has a new look! Let us know what you think.

Flashcards

Interface

BLU BLU German 4 cards

Cards in this deck (4)

  1. 1What is an interface?- Blueprint of a class
    - Collection of Abstract Methods
    - Contract between the class and outside world
    - is a relationship
  2. 2Difference between Abstract Class and InterfaceAbstract:
    - Abstract and non abstract methods
    - Final, non-final, static, non-static variables
    - Members like private, protected
    - Extend class, implement multiple interfaces
    Interface:
    - Abstract methods
    - Static and final variables by default
    - public by default
    - Only another Interface can extend an interface
  3. 3Static Methods in Interface- The keyword is "static"
    - Can have any number of static methods
    - Can't override the static method
    - Can't define method of java.lang.Object as static methods
    - For common behavior static methods are used
    - Using interface name static methods are called
    - From Java 9 onwards in Interfaces we can create private methods and private static methods (to have higher code reusability)
  4. 4Comparison Java 7, Java 8 and Java 9Java 7:
    - Constant variables
    - Abstract methods
    Java 8:
    - Constant variables
    - Abstract methods
    - Default methods
    - Static methods
    Java 9:
    Constant variables
    - Abstract Methods
    - Default Methods
    - Static Methods
    - Private Methods
    - Private Static Methods

Information

Description
Flashcards on Interface, created by BLU BLU on 27/01/2025.
Created by
BLU BLU
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?