Cpp Inheritance Example In Java