How do I create a subobject from a variable class

Thats what my code is trying to do, but it doesnt compile. It doesnt like the

<BasicAttackClass>