Dynamically load class

Ok, first off, I’m new here, so sorry if this is in the wrong place :frowning: if it is, let me know, and i’ll re-post it in the right place

now that’s out the way, down to business.

I’ve just started out on a voxel-engine for making my future 3D games, so i’m not reinventing the wheel (or block as it were), every time i make a game (since most my games have been block based, or as i’ve come to lovingly call them, 3D tile based games, anyway).

What i really want to do, is allow for other people to add “blocks” into my game. so, I’ve decided that the best way to do that, is to dynamically load class’s that match a standard template. And using a Map to hold them, so they can be “called”/identified by name. I’ll also be using a loader, that reduces the risk of conflict, by renaming files that have the same name.

So, what i need to work out is how to dynamically load a class, and then be able to call its methods.

Heres an example of what all the class’s WILL (moders permitting) will look like:
[spoiler]


public class block{
        /*there may or may not be variables stored here, for example, my TNT will have a count down variable stored here when its done*/
	
	public block(float x, float y, float z){
	/*used to set all parameters for the block, will only be passed the x,y,z values. by default, this is the bottom left front corner of the cube*/
	}

        public void interact(){
	/*this is what happens when the player interacts with the block.*/
	}
	
	public void jump(){
	/*this is what happens when the player is stood on top of the block (will probably remain empty)*/
	}
	
	public void bump(){
	/*if the player walks into the side of the block*/
	}
	
	public void update(){
	/*called every game loop, to make any changes, such as movement, or checking for [i]some[/i] collisions*/
	}
	
	public void render(){
	/*called EVERY loop, otherwise the block vanishes*/
	}

[/spoiler]

any hints on how to load and call these class’s would be much appreciated.

if its relevant, all class’s will be .class files.

Thanks in advance

DAN