What is template class in c++

I am learning C++.
I have learnt basic concept of C++ like class,object. I have trouble learning template class in C++. Anybody will tell me what is a template class in C++.
Why we use this in our program and i have given a template class program here i don't know Why is the namespace used here?

