Added class templates in java and c++