Event usage in a class member function

In reply to bharath123:

It is always helpful to include the exact error message or symptom you are seeing so we know exactly you’re having trouble with.

As Srini mentions line 13 of your code

task my_new@(ev1);

is not valid syntax as it currently exists

You also don’t ever appear to call the task ‘my_new’ that I see.