c#
-
what is the mainwork of constructtor:confused:
hi friends do somthing different........from other..........
-
what is the mainwork of constructtor:confused:
hi friends do somthing different........from other..........
-
what is the mainwork of constructtor:confused:
hi friends do somthing different........from other..........
To construct a new object, for example a person object: new Person("moron", true);
-
what is the mainwork of constructtor:confused:
hi friends do somthing different........from other..........
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
-
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
opps ugly message - and I cant edit it :P. just search the definition!!
Mark Brock Click here to view my blog