A constructor in essance is a method (with the same name as the Class) that is executed when an instance of the class is created.
For Example:
public class foo {
public int x;
// Constructor
public foo() {
// Do something like
this.x = 45;
}
}
So when you enter in your application:
foo x = new foo() // the constructor foo() is executed.
Reputation Points: 11
Solved Threads: 1
Junior Poster in Training
Offline 84 posts
since Sep 2004