Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

what is interface

Interfaces specify what a class must do. 
It is the blueprint of the class.
It is used to achieve total abstraction. 
We are using implements keyword for interface.

Basic statement we all know in Selenium is
WebDriver driver = new FirefoxDriver();
WebDriver itself is an Interface.
So we are initializing Firefox browser
using Selenium WebDriver.
It means we are creating a reference variable
of the interface and creating an Object.
So WebDriver is an Interface and
FirefoxDriver is a class.


Comment

interfaces are used as

 It is used to achieve total abstraction.
 Since java does not support multiple inheritance in case of class, but by using interface it can achieve multiple inheritance .
 It is also used to achieve loose coupling.
Comment

interface definition

Interface Define a set of Characteristics and Behaviors 
such as 
Member Signature Only
No Implementation Details
Cannot be Instantiated
Comment

interfaces

class Calculator(AdvancedArithmetic):
    def divisorSum(self, n):
        temp = []
        for i in range(1, n+1):
            if n%i == 0:
                temp.append(i)
        return sum(temp)
Comment

interface example

import { Component } from '@angular/core';

//Student interface
  
interface Student {
    id: number;
    name: string;
}
  
@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = 'Angular';
    //Use of interface
  students: Student[] = [
    {id: 1, name: "Hardik"},
    {id: 2, name: "Paresh"},
    {id: 3, name: "Rakesh"},
  ]
}
Comment

PREVIOUS NEXT
Code Example
Python :: print column name and index dataframe 
Python :: Showing all column names and indexes dataframe python 
Python :: django cache framework 
Python :: object has no attribute python 
Python :: sys.argv python example 
Python :: Facet Grid for Bar Plot with non-shared y axes (CatPlot) 
Python :: facet grid, barplot, catplot 
Python :: Python - How To Pad String With Spaces 
Python :: buble short 
Python :: opencv find image contained within an image 
Python :: django model make the field caseinsensitive 
Python :: WARNING: Ignoring invalid distribution -ip (c:python310libsite-packages) 
Python :: doormat pattern 
Python :: python calander from Programmer of empires but updated 
Python :: list all items in digital ocean spaces 
Python :: Third step creating python project 
Python :: sarah 
Python :: how to deploy to shinyapps.io 
Python :: tz convert python 
Python :: tekinter python 
Python :: df.iterrows write to column 
Python :: menampilkan data dalam range tertentu di python 
Python :: concatenate the next row to the previous row pandas 
Python :: how to code a discord bot in python nextcord 
Python :: crop a video opencv 
Python :: form a chakravyuh matrix python 
Python :: convert month weeks days into month days in python pandas 
Python :: np.argmax python could not be evaluated 
Python :: comment enleve les chiffre duplice d une liste python 
Python :: python round and map function 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =