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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. C# notation difference

C# notation difference

Scheduled Pinned Locked Moved C#
csharp
3 Posts 2 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.
  • S Offline
    S Offline
    Serge Lobko Lobanovsky
    wrote on last edited by
    #1

    Hi people, Can you tell me is there any real difference between: IMyObject obj = (IMyObject) otherObject; and IMyObject obj = otherObject as IMyObject; Thanks Regards, Serge (Logic Software, Easy Projects .NET site)

    S 1 Reply Last reply
    0
    • S Serge Lobko Lobanovsky

      Hi people, Can you tell me is there any real difference between: IMyObject obj = (IMyObject) otherObject; and IMyObject obj = otherObject as IMyObject; Thanks Regards, Serge (Logic Software, Easy Projects .NET site)

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Serge Lobko-Lobanovsky wrote: IMyObject obj = (IMyObject) otherObject; Will throw an exception on conversion failure. Serge Lobko-Lobanovsky wrote: IMyObject obj = otherObject as IMyObject; Will assign null on conversion failure. Take a look at the documentation for as[^].


      www.troschuetz.de

      S 1 Reply Last reply
      0
      • S Stefan Troschuetz

        Serge Lobko-Lobanovsky wrote: IMyObject obj = (IMyObject) otherObject; Will throw an exception on conversion failure. Serge Lobko-Lobanovsky wrote: IMyObject obj = otherObject as IMyObject; Will assign null on conversion failure. Take a look at the documentation for as[^].


        www.troschuetz.de

        S Offline
        S Offline
        Serge Lobko Lobanovsky
        wrote on last edited by
        #3

        Thanks, I should have :) Regards, Serge (Logic Software, Easy Projects .NET site)

        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