Constructors


A constructor method for a class has the same name as the class itself. Multiple constructors can be declared provided they have unique sets of parameters.
public class ComplexFloat
{
   private float real, imag;

   ComplexFloat( float x, float y )
   {
      ...[initialise from floats]
   }

   ComplexFloat( long x, long y )
   {
      ...[initialise from longs]
   }
}