C# Beginner to advanced - Lesson 26 - Interfaces Part 1

مجله خبری، آموزشی پرشین تک
منتشر شده در 11 خرداد 1397

Interfaces:


  • Interfaces are created using “Interface” keyword.
  • Similar like classes Interfaces also have properties, methods ,delegates and events.
  • But the difference between classes and Interfaces is , Interfaces can have only declarations but no implementations.
  • Interface members are public by default, they don’t allow explicit access modifiers.
  • If a class or struct inherits from an interface, it must provide implementation for all interface members. Otherwise, we will get an compile time error.

*A class or struct can inherit from more than one interface at the same time, but where as, a class cannot inherit from more than one class at the same time.

*Interfaces can inherit from other interfaces. A class that inherits this interface must provide implementation fro all interface members in the entire interface inheritance chain.

  • Instance of interface cannot be created but an interface reference variable can point to a derived class object

ankpro

ankpro training

Asp.net MVC

C#

C sharp

Bangalore

Rajajinagar

Selenium

Coded UI

Mobile automation testing

Mobile testing

JQuery

JavaScript

.Net

Components of the .Net framework

Hello World

Literal

Keywords

Variable

Data types

Operators

Branching

Loops

Arrays

ArrayList

Strings

String Builder

Structures

Enums

Functions

Classes

Inheritance

Polymorphism

Properties

Indexers

Events

Nested Classes

Delegates

Anonymous methods

Labda expressions

Abstract classes

Exception Handling

Linq

Interfaces

Extension methods

Anonymous types

Generics

Collections

Garbage Collection

Reflection

Attributes

Input and output statements

Type casting

Boxing and Unboxing

Var vs Dynamic vs Object

دیدگاه کاربران