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. c#

c#

Scheduled Pinned Locked Moved C#
csharpquestion
5 Posts 4 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
    subhankarbiswas
    wrote on last edited by
    #1

    what is the mainwork of constructtor:confused:

    hi friends do somthing different........from other..........

    P B M 3 Replies Last reply
    0
    • S subhankarbiswas

      what is the mainwork of constructtor:confused:

      hi friends do somthing different........from other..........

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      A couple of points. 1. We know it's C#. Please choose a more meaningful title. 2. A quick search in google turnd up this[^]

      modified on Friday, May 30, 2008 5:59 PM

      1 Reply Last reply
      0
      • S subhankarbiswas

        what is the mainwork of constructtor:confused:

        hi friends do somthing different........from other..........

        B Offline
        B Offline
        Bert delaVega
        wrote on last edited by
        #3

        To construct a new object, for example a person object: new Person("moron", true);

        1 Reply Last reply
        0
        • S subhankarbiswas

          what is the mainwork of constructtor:confused:

          hi friends do somthing different........from other..........

          M Offline
          M Offline
          MarkB777
          wrote on last edited by
          #4

          Straight from a google search of "constructor"

          In object-oriented programming, a constructor (sometimes shortened to ctor) in a class is a special block of statements called when an object is created, either when it is declared (statically constructed on the stack, possible in C++ but not in Java and other object-oriented languages) or dynamically constructed on the heap through the keyword “new”.

          A constructor is similar to an instance method, but it differs from a method in that it never has an explicit return type, it's not inherited, and usually has different rules for scope modifiers. Constructors are often distinguished by having the same name as the declaring class. Their responsibility is to initialize the object's data members and to establish the invariant of the class, failing if the invariant isn't valid. A properly written constructor will leave the object in a 'valid' state. Immutable objects must be initialized in a constructor.

          Cheers,

          Mark Brock Click here to view my blog

          M 1 Reply Last reply
          0
          • M MarkB777

            Straight from a google search of "constructor"

            In object-oriented programming, a constructor (sometimes shortened to ctor) in a class is a special block of statements called when an object is created, either when it is declared (statically constructed on the stack, possible in C++ but not in Java and other object-oriented languages) or dynamically constructed on the heap through the keyword “new”.

            A constructor is similar to an instance method, but it differs from a method in that it never has an explicit return type, it's not inherited, and usually has different rules for scope modifiers. Constructors are often distinguished by having the same name as the declaring class. Their responsibility is to initialize the object's data members and to establish the invariant of the class, failing if the invariant isn't valid. A properly written constructor will leave the object in a 'valid' state. Immutable objects must be initialized in a constructor.

            Cheers,

            Mark Brock Click here to view my blog

            M Offline
            M Offline
            MarkB777
            wrote on last edited by
            #5

            opps ugly message - and I cant edit it :P. just search the definition!!

            Mark Brock Click here to view my blog

            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