public TransparentProxy() {} ---is a Constructor
Java constructors are the methods with the same name as the Class with no return type/value. They are called or invoked when an object of class is created and can't be called explicitly. An object of a class is created using the new
keyword. Ex: TransparentProxy proxy = new TransparentProxy();
Three types of Constructors are present.
1. Default Constructor
JVM internally declares a constructor when no constructor in specified. This is to allow a class to create an instance of it. Also, an Interface in Java does not have a constructor and hence no instances/object can be created.
2. Zero argument Constructor
A constructor defined with no arguments is called a Zero argument Constructor. You may use it to initialize variables to some value to begin with. All objects/instances of the class will have the same initial values.
3. Constructor with arguments
Its a constructor defined with arguments which initialize the variables of the class at the time of object creation. Every object/instance created of that class will have different initial values depending on the values passed to the constructor.
A constructor can be overloaded with different type of arguments or the number of arguments.
It cannot be overrided in a sub class.
Read here -- Why do constructors not return values?