What does a constructor return in Java?

This is a little confusing: constructors indeed do not return a value; it is operator new that does. However, constructors are always used with a new*, so it looks like they always return a value.


* This is a slight simplification: you can use a constructor without new if you go through reflection. However, the same mechanisms will be in play.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)