Support us .Net Basics C# SQL ASP.NET Aarvi MVC Slides C# Programs Subscribe Download

Part 30 - C# Tutorial - Interfaces in C#


Part 30 - C# Tutorial - Interfaces


13 comments:

  1. thanks for your very good tutorial, btw part 30 , 31, 38, 41, 45, 50 wont load. thanks again in advance for your help

    ReplyDelete
    Replies
    1. Hi Carlo, I am able to play them without any problem. Here is the youtube playlist for C#. Hopefully you will be able to play it from here. Please let me know if you still have problems.
      C# Youtube Playlist

      Delete
  2. Hi venkat,

    I have an interface that interface have one method for example void Add().I implemented that void Add() method in 100 class then I would like to Change the method in Interface void add() into int Add().So I Could not change int add() method in 100 class.without changing int add() method in 100 class.How to resolve this case. Could You please guide me?

    ReplyDelete
  3. am really gald to you sir, you help me to find my way .. thanks alot for your effort

    ReplyDelete
  4. Hi Venkat,

    Can you also include sessions on Lambda expressions and Anonymous methods.?

    ReplyDelete
  5. Sir, videos are really very good , well explantory. Its really helping a lot.. But please can u upload the scripted version of these videos too.please its a request.

    ReplyDelete
  6. best tutorial I have ever seen. Thank you so much sir.

    ReplyDelete
  7. using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;

    namespace Console_Application_Interface
    {
    interface ICustomer
    {
    void print();

    }
    interface I2Customer:ICustomer
    {
    void display();
    }
    public class Customer :I2Customer
    {
    public void print()
    {
    Console.WriteLine("Hello Pranab");
    Console.ReadKey();

    }
    public void display()
    {
    Console.WriteLine("Hello Beta");
    Console.ReadKey();
    }


    }

    public class Program
    {
    public static void Main(string[] args)
    {

    Customer C1 = new Customer();
    C1.print();
    C1.display();

    }
    }
    }

    Expected output should be...
    Hello Pranab
    Hello Beta
    but I am only getting Hello Pranab as an output...Plz tell me who knows d answer how to get d correct output.......

    ReplyDelete
    Replies
    1. don't use Console.ReadKey(); comment it....after that it will work fine

      Delete
    2. delete console.readkey() after print() but use that after display() beacuse it will stops the execution after print method

      Delete
    3. Remove Console.ReadKey(); From both the Child Class and add Console.ReadLine(); at last in Main Method

      Delete
  8. i had some difficults go understand interfaces but now it is more
    easy for me to understand them thank you so .

    ReplyDelete
  9. Q. if an interface implements no functionality then why should we use them?

    ReplyDelete

It would be great if you can help share these free resources