Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Interface

Interface

Scheduled Pinned Locked Moved C#
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rahul83
    wrote on last edited by
    #1

    Hi friends, While going through Interface topic I came across this doubt..say there is a class called Myclass which implements an interface called ImyInterface..there is a line of code: ImyInterface xyz=new Myclass() can u plz explain me what this line of code actually means in terms of object and reference. Warm Regards, Rahul

    A H 2 Replies Last reply
    0
    • R Rahul83

      Hi friends, While going through Interface topic I came across this doubt..say there is a class called Myclass which implements an interface called ImyInterface..there is a line of code: ImyInterface xyz=new Myclass() can u plz explain me what this line of code actually means in terms of object and reference. Warm Regards, Rahul

      A Offline
      A Offline
      Arun Immanuel
      wrote on last edited by
      #2

      Normally base class pointer can point to a derived class object. Here, "new MyClass()" is a derived class Object(since MyClass implements ImyInterface ) and "xyz" is the base class pointer. MyClass will implement(define) functions in the Base interface.It can also contain its own new functions. Even though "xyz" points to an object which contain many functions,through "xyz" we will be able to call only the functions present in the interface.

      Regards, Arun Kumar.A

      1 Reply Last reply
      0
      • R Rahul83

        Hi friends, While going through Interface topic I came across this doubt..say there is a class called Myclass which implements an interface called ImyInterface..there is a line of code: ImyInterface xyz=new Myclass() can u plz explain me what this line of code actually means in terms of object and reference. Warm Regards, Rahul

        H Offline
        H Offline
        Hesham Yassin
        wrote on last edited by
        #3

        it means nothing or if it means something, there are only two options: 1. it's error 2. the two classes are inherited! but i'm not really sure of this option!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups