[Solved] Can I construct more than one type of object from same class data with the help of constructor in Java?


No, you can’t do that.

The two constructors would have the same signature: MyClass(double, double, double).

In order to distinguish the two, you’d have to give them different names, and you can’t do that with constructors.

You can however create differently named static methods to use instead of constructors, e.g.

public class MyClass {
    // fields here
    public static MyClass forObject1(double a, double b, double c) {
        return new MyClass(a, b, c, 0);
    }
    public static MyClass forObject2(double a, double c, double d) {
        return new MyClass(a, 0, c, d);
    }
    private MyClass(double a, double b, double c, double d) {
        // assign to fields here
    }
    // methods here
}

solved Can I construct more than one type of object from same class data with the help of constructor in Java?