This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In the first example, you have a generic class with type T, which needs to be defined (exact type hiding behind the T) by creating a new Test class object.
At the same moment, the same type T is used for static method, which can be executed without creating a Test class object which cannot be made.
The second example runs, because you declare the <T> type within the static method - not on class level, so it's fine.
It is also related to the URL passed above. You can define a reference type to an array of concrete parametrized type, but you cannot instantiate this array.
By saying this:
You are defining your own parametrized type named String (by convention, normally these are named like T or E). There is nothing preventing you from naming the generic type as the class name that already exist. Remember it has nothing with the extension of the class - it is just shadowing.
Therefore, the "my" reference variable is not a java.lang.String reference type, but your own String type reference, which cannot be assigned to String literal ("Hello!").
Good to point out such depth things but in OCJP real exam it will not be such depth. If you take online training or if you read the books like K&B you will come to know at what level the questions are being asked in the exam.