
It is not common but you are allowed to have several classes with
the same name. For example, the Java class library has three classes
named Timer. 

But the three Timer classes do not really have the same name. Each
Timer class is in a different package. And the real name of any
class is its full package name. So the three Timer classes do
not have the same full package name.

   java.util.Timer;
   javax.swing.Timer;
   javax.management.timer.Timer;

You can use all three Timer classes in a program, but you can import
only one of them. The other two must be referred to using their full
package name.

You are not allowed to have two classes with the same name in a single
package. For one thing, the computer's file system will not let you
put two files with the same name into a folder.
