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

In reply to sriram.seshagiri:

Hi Dave,

I am kind of having the same confusion still.

In the uvm_sequence_base, the task “body” is declared to be of type virtual, then why are they again defining it to be of type virtual when they create the custom sequence extending the base sequence in all the example given along with the ovm package. Is there any specific need for the same??? If so kindly please let me know.

since the base sequence class is already virtual what s the need of the custom sequence also having the virtual method for task body ?

As a quick example: Here it is not reqd for class D to be virtual

class C;
   virtual function void display();
    $display("C!");    
  endfunction : display
endclass : C
 
class D extends C;
   function void display();
    $display("D!");      
  endfunction : display
endclass : D

class E extends D;
  int a;
   function void display();
     $display("E!");      
  endfunction : display
endclass : E


initial begin
D D0 = new();
      E E0 = new();
D0 = E0;
      D0.display();
end