Constructors are used to create objects (instances of a class). They are declared like methods but always using the name of the class and having no return type. Be careful about tricky questions like this: Is the following an example of a valid constructor? Does it compile?
1 2 3 4 5 6 |
class A { public void A() { } } |
A method name ..Continue Reading