title: PHP like Autoloader in Java
body: <p>Does the Java Interpreter support an Autoloader-Function or a possibility to extend his "Looking for a class"-function? </p>
  
  <p>In PHP there is a function called spl_autoload_register (see <a href="http://www.php.net/manual/en/function.spl-autoload-register.php" rel="nofollow">http://www.php.net/manual/en/function.spl-autoload-register.php</a> for details ), which forces the interpreter to execute my own callback function when he is looking for a missing class. In my callback function I can include the file with the expected class.</p>
  
  <p>The background-idea is that I'd like to switch dynamically between software-layers. </p>
  
  <p>For example: <br /> 
  If class x_L2 exists in layer 2 then class x_L1 in the underlying layer 1 should be ignored. Actually I solved this issue with a general mirror class x, which have to inherit from the class in the highest available layer. But this way is error-prone when you have to maintain hundreds of classes.</p>
  
  <p>Thanks in advance.</p>