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. On Virtual And Override

On Virtual And Override

Scheduled Pinned Locked Moved C#
questioncsharp
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.
  • G Offline
    G Offline
    GetOn GetGoing
    wrote on last edited by
    #1

    Hi Folks Hope you all are having a good knowldze on C#. Here i want to know one thing , At runtime how runtime will decide what to use I mean either virtual one or overrided one. two more Question What is the difference between Abstract class and interface We know some basic differences. when to use structures and when to use classes Praveen Chintamani.

    T 1 Reply Last reply
    0
    • G GetOn GetGoing

      Hi Folks Hope you all are having a good knowldze on C#. Here i want to know one thing , At runtime how runtime will decide what to use I mean either virtual one or overrided one. two more Question What is the difference between Abstract class and interface We know some basic differences. when to use structures and when to use classes Praveen Chintamani.

      T Offline
      T Offline
      TigerNinja_
      wrote on last edited by
      #2

      praveenc80 wrote: At runtime how runtime will decide what to use I mean either virtual one or overrided one. That is polymorphism, the compiler will take care of that for you. Whatever your object "is a" instance of will be called. praveenc80 wrote: What is the difference between Abstract class and interface Abstract class can't be instantiated. Interface is good to use if you want to enforce a method on certain objects, but those objects might not have a base->child relationship. For example, look at IDisposable, Microsoft classes that implemenet this interface support the Dispose() method to cleanup resources. praveenc80 wrote: when to use structures and when to use classes Your call really. Structures are stored on the stack and classes are on the heap. Strcutures are not as powerful as classes, but are more quickly accessed from memory. I could imagine using structs for something not so object oriented. Hope this gives you a starting point.


      R.Bischoff  .NET, Kommst du mit?

      H 1 Reply Last reply
      0
      • T TigerNinja_

        praveenc80 wrote: At runtime how runtime will decide what to use I mean either virtual one or overrided one. That is polymorphism, the compiler will take care of that for you. Whatever your object "is a" instance of will be called. praveenc80 wrote: What is the difference between Abstract class and interface Abstract class can't be instantiated. Interface is good to use if you want to enforce a method on certain objects, but those objects might not have a base->child relationship. For example, look at IDisposable, Microsoft classes that implemenet this interface support the Dispose() method to cleanup resources. praveenc80 wrote: when to use structures and when to use classes Your call really. Structures are stored on the stack and classes are on the heap. Strcutures are not as powerful as classes, but are more quickly accessed from memory. I could imagine using structs for something not so object oriented. Hope this gives you a starting point.


        R.Bischoff  .NET, Kommst du mit?

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        Soliant wrote: Abstract class can't be instantiated. Interfaces are also nice because a class can only extend one other class. If you use abstract classes and need to inherit additional functionality (say, from Control), you won't be able to because you're already extending one abstract base class. This is where interfaces come in handy because you an implement more than one interface. Soliant wrote: I could imagine using structs for something not so object oriented. Structures should really only be used for small amounts of short-lived data, such as a Size or a Point (both used to position and size a control, but then aren't needed again things change).

        Microsoft MVP, Visual C# My Articles

        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