I\'m following this tutorial on Java annotaitons and implemented the Test annotation as shown there. But when running the code I get the following output.
java.l
The problem is that you are passing a null target object to method.invoke(object)
method.
The target object should not be null, else a nullpointerexception is expected.
The invoke method has below usages:
Method.invoke(targetObject, args1, args2, args3...); where args1, args2, args3 etc are argument to the method being invoked.