|
|
| ASP Discuss about ASP scripting problems or help others with their ASP scripting issues. |

10-21-2010, 11:04 AM
|
|
Senior Member
|
|
Join Date: Jul 2010
Location: delhi ( india )
Posts: 508
|
|
what is Constucter?
plz reply the my question...
Thank you.....
|

11-10-2010, 07:55 AM
|
|
Member
|
|
Join Date: Nov 2010
Posts: 85
|
|
|
class Rectangle{
int l, b;
float p, q;
public Rectangle(int x, int y){
l = x;
b = y;
}
public int first(){
return(l * b);
}
public Rectangle(int x){
l = x;
b = x;
}
public int second(){
return(l * b);
}
public Rectangle(float x){
p = x;
q = x;
}
public float third(){
return(p * q);
}
public Rectangle(float x, float y){
p = x;
q = y;
}
public float fourth(){
return(p * q);
}
}
|

11-23-2010, 06:54 AM
|
|
Senior Member
|
|
Join Date: Jul 2010
Location: punjab
Posts: 109
|
|
|
HI,
Thank you for the solved the my problem.
Your Regards,
Jagbani..
|

12-06-2010, 05:44 AM
|
|
Member
|
|
Join Date: Nov 2010
Location: Delhi
Posts: 97
|
|
|
HI,
Constructor is function which describe from the class name.we use the Constructor when we do not describe the class object in main method.
|

04-13-2011, 04:34 PM
|
|
Member
|
|
Join Date: Nov 2010
Location: Delhi
Posts: 97
|
|
|
Constructor:-
Constructor is like a class function if we be called the without define the object of the class then we use the constructor.
Syntax:-
class Add
{
public Add()
{
int a=20;
int b=30;
int result= a+b;
console.WriteLine("The Value is"+result);
}
public static void main(String [] args)
{
}
}
|

04-13-2011, 06:54 PM
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 16
|
|
Quote:
Originally Posted by jurwanwall
class Rectangle{
int l, b;
float p, q;
public Rectangle(int x, int y){
l = x;
b = y;
}
public int first(){
return(l * b);
}
public Rectangle(int x){
l = x;
b = x;
}
public int second(){
return(l * b);
}
public Rectangle(float x){
p = x;
q = x;
}
public float third(){
return(p * q);
}
public Rectangle(float x, float y){
p = x;
q = y;
}
public float fourth(){
return(p * q);
}
}
|
It is a great a clear answer, i learn it too
|

05-12-2011, 07:10 AM
|
|
Junior Member
|
|
Join Date: Apr 2011
Posts: 7
|
|
|
some times we can say that constructor is a class but its not exactly a class.but its having the same name of the class.it automatically called at the time of execution.
|

05-13-2011, 07:07 AM
|
|
Member
|
|
Join Date: Apr 2011
Posts: 39
|
|
|
onstructor are used for initialization of member variables.Constructor are automatically invoked when the object is created.Constructor doesn't have any return type not even void.Constructor have the same name as the class name.We can't call the constructor explicitly.
|

06-17-2011, 01:55 PM
|
|
Senior Member
|
|
Join Date: May 2011
Posts: 392
|
|
constructor
A constructor is just like a function but it has the same name as the class does, and is called whenever the object of that class is being created.
|

07-01-2011, 06:52 AM
|
|
Senior Member
|
|
Join Date: Jul 2011
Posts: 111
|
|
|
constructor is method of class when we create the object then create the automatically constructor.
|

07-04-2011, 01:11 PM
|
|
Member
|
|
Join Date: Jun 2011
Posts: 80
|
|
|
When a object is created, the variable of the objects must be initialized. Initialization of variable of object is done automatically when the object is created .The object is initialized at the time of creation of it by means of a special function. This special function is known as constructor. It is called as constructor because it constructs the value of data member of class
|

10-10-2011, 06:59 AM
|
|
Senior Member
|
|
Join Date: Sep 2011
Posts: 166
|
|
|
A copy constructor is a special constructor in the C++ programming language creating a new object as a copy of an existing object.Copying of objects is achieved by the use of a copy constructor and an assignment operator. A copy constructor has as its first parameter a reference to its own class type. It can have more arguments, but the rest must have default values associated with them
|

02-07-2012, 12:10 PM
|
|
Senior Member
|
|
Join Date: Oct 2011
Posts: 166
|
|
|
Constructor is a default member function available with a
class.
|

03-06-2012, 12:58 PM
|
|
Senior Member
|
|
Join Date: Feb 2012
Posts: 221
|
|
|
Constructor:-
A particular member function whose task is to initialize the object of class.
Last edited by sandeep552 : 03-06-2012 at 12:59 PM.
Reason: Spell Mistake
|

03-15-2012, 08:02 AM
|
 |
Senior Member
|
|
Join Date: Mar 2012
Location: New York, USA
Posts: 162
|
|
|
However constructor name and class name are same and helpful to initialized the object of the class at the static scenario.
|

05-10-2012, 12:59 PM
|
|
Junior Member
|
|
Join Date: May 2012
Location: Faridabad
Posts: 12
|
|
|
In object-oriented programming, a constructor (sometimes shortened to ctor) in a class is a special type of subroutine called at the creation of an object....
|

05-22-2012, 07:14 AM
|
|
Junior Member
|
|
Join Date: Mar 2012
Posts: 19
|
|
|
When a object is developed, the different of the elements must be initialized. Initialization of different of product is done immediately when the product is developed .The product is initialized at a lot of length of technology of it through a exclusive work. This exclusive work is known as constructor. It is known as as constructor because it constructs the value of details individual of class
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +1. The time now is 11:24 AM.
|