The thing I think you're describing is a feature of languages called reflection or introspection.
Apex does not really have either of those. The closest thing we have is the Type
class, which we can use to dynamically instantiate objects.
// Type.forName() allows us to use a string to determine which class to instantiate
// It returns an Object though, so this isn't of much use beyond using it for things that
// extend other classes or implement interfaces.
// Objects need to be cast to another type to really be of any use, and the typecast can't
// be dynamic (the type needs to be known at compile-time)
MyClass mcInstance = (MyClass)Type.forName('MyClass').newInstance();
If you want/need the name of a class inside of that class, then I think the best we can do is something like this
public class MyClass{
// "final" makes the variable a constant (write once)
public final className;
public MyClass(){
// <class name>.class gets you an instance of System.Type
// Basically, it's the statically compilable version of Type.forName().newInstance()
// System.Type has a getName() method which returns the name of the type
this.className = MyClass.class.getName();
}