Besides groovy is way more dynamic then java…
Why is this a compile time error in groovy (unexpected token <):
interface A {
<T> T getByClass(Class<T> clazz)
}
How do I write this the groovy way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Groovy parser does not handle method signatures beginning with Generic information…
It parses if you add the public modifier:
Though I don’t believe you’ll gain any type checking at compile time for adding this annotation