Why the task body() inside sequence is of type virtual?

In reply to UVM_LOVE:

The reason has to do the way virtual methods get called via a lookup table.

class_variable.method_called(arguments)

The compiler looks at the type of ‘class_variable’ and sees how ‘method_called’ is defined. If a virtual method, it then looks at the object type stored in class_variable and uses that to check which method gets called. The problem with a later non-virtual method is that class_variable only know about the method prototype for that point in the inheritance tree, so it assumes all later derived methods are virtual.

Also, to answer the original question better, body() has to be virtual so it can be called from the uvm_sequence base class variable. Thats why build_phase etc. are all virtual too.