I have browsed the forum but could not find a solution for the below (i.e a class with overloaded constructors). a B4J class does require the default Initialize method (can modify to pass parameters) but how would one go about to allow for all 3 the constructors in a B4J class as per java code below?
B4X:
public class V2D {
private double x;
private double y;
private double norm;
// ------------
// constructors
// ------------
public V2D() {
this.x = 0.0;
this.y = 0.0;
}
public V2D(double x, double y) {
this.x = x;
this.y = y;
}
public V2D(V2D p) {
this.x = p.getX();
this.y = p.getY();
}