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. use other name of class

use other name of class

Scheduled Pinned Locked Moved C#
tutorial
7 Posts 5 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.
  • A Offline
    A Offline
    abedo1982
    wrote on last edited by
    #1

    I want to use other name of class for example: this is a simple class: class Myclass { private int _No; public Myclass() { } public int No { get{return _No;} } } I want to use other name a new name (Nocc) for Myclass Nocc N1=new Nocc(); N1.No=91;

    D I 2 Replies Last reply
    0
    • A abedo1982

      I want to use other name of class for example: this is a simple class: class Myclass { private int _No; public Myclass() { } public int No { get{return _No;} } } I want to use other name a new name (Nocc) for Myclass Nocc N1=new Nocc(); N1.No=91;

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Your Myclass doesn't have another name. Where did this Nocc thing come from?

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Your Myclass doesn't have another name. Where did this Nocc thing come from?

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007

        A Offline
        A Offline
        abedo1982
        wrote on last edited by
        #3

        first thank you for reply Nocc is the new name i want to use it Like Myclass i do not know what's the command to do something like this thanks in advance,

        D 1 Reply Last reply
        0
        • A abedo1982

          I want to use other name of class for example: this is a simple class: class Myclass { private int _No; public Myclass() { } public int No { get{return _No;} } } I want to use other name a new name (Nocc) for Myclass Nocc N1=new Nocc(); N1.No=91;

          I Offline
          I Offline
          irishdunn
          wrote on last edited by
          #4

          class Nocc { #region Variables private int _no; #endregion #region Constructors public Nocc() { } #endregion #region Properties public int No { get {return (_no);} set {_no = value;} } #endregion } I have no idea what your asking for... I just like #regions ;P

          G 1 Reply Last reply
          0
          • A abedo1982

            first thank you for reply Nocc is the new name i want to use it Like Myclass i do not know what's the command to do something like this thanks in advance,

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            A class cannot have two names. To use the Nocc name all you'd have to do is replace MyClass with Nocc in the class definition.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            • I irishdunn

              class Nocc { #region Variables private int _no; #endregion #region Constructors public Nocc() { } #endregion #region Properties public int No { get {return (_no);} set {_no = value;} } #endregion } I have no idea what your asking for... I just like #regions ;P

              G Offline
              G Offline
              Giorgi Dalakishvili
              wrote on last edited by
              #6

              irishdunn wrote:

              I have no idea what your asking for

              I think he means aliasis. Like String and string. System.Int32 and int :)

              L 1 Reply Last reply
              0
              • G Giorgi Dalakishvili

                irishdunn wrote:

                I have no idea what your asking for

                I think he means aliasis. Like String and string. System.Int32 and int :)

                L Offline
                L Offline
                led mike
                wrote on last edited by
                #7

                Giorgi Dalakishvili wrote:

                I think he means aliasis. Like String and string. System.Int32 and int

                Oh then: using Nocc = MyClass; // then in code: Nocc mything = new Nocc(); // etc

                led mike

                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