Unfortunately, your example doesn't make much sense to me. Is method1 supposed to be creating an instance of "A" rather than of "Thread"?
In any case, Threads do indeed have a "name" -- you can call getName() on any Thread object to get its name. But the name of the main Thread, or of any other thread created by the JVM itself, is arbitrary -- it could be anything at all. So if that's what you're asking about, the answer is that there's no way to know in advance, but method1() can call Thread.currentThread().getName() to get the main Thread's name at runtime.
If you're asking something else, then you're going to have to explain your question more clearly.