If by
template class SampleClass2
you mean
template class SampleClass2
then there is no difference. The use of class
and typename
(in the context of a template parameter that refers to a type) is interchangeable.
The reason that both keywords are allowed here is historical. See this article for a detailed explanation.