There is no way to hold the return value of constructor , because the constructor is called when the object is instantiated;
Now in above situation before the assignment operator (=) i.e. at holding position a user defined type (your class type which have different set of method to dealt with its internal type) is placed. If you trying to hold any other type (e.g. primitive types are user defined type (class)) then it is illegal.
Let us take a simple example to illustrate it.
Suppose there is a hypothetical situation as:
Private int num1;
Peivate int num2;
Public int Demo()
Now we create object of this class as:
There are following reasons that causes the constructors never return any value as:
1. Firstly In hypothetical approach get fail, because the type, demo(which contains two integer as member as a single data type “demo”).on other hand type int as single data unit;
2. Second one demo type is creating reference that already referenced by type “int res”, which is absolutely wrong approach, and never possible.
3. Thirdly suppose that for a time movement, the approach was right. Then how we initialize the Demo object with single integer value return by the constructor, I think it is almost not possible ;
Thus the conclusion is that, it is not possible to be constructor with return type exist, by technically, syntactically are programmatically.