How to get the runtime class?



I have 2 classes

abstract public class foo {


public void bar() { // i want a Class object of "this"

Class c = this.getClass(); // here i get a class of type foo, even if the runtime class is type foo2
}
}


public class foo2 extends foo {

....
}

with other words, how to get the children object from the parent object?
.