sunidrak
Full Member level 1
- Joined
- Apr 12, 2012
- Messages
- 97
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Bengaluru, India
- Activity points
- 1,738
Can anybody plz explain the difference and meaning of the two Code Snippet highlighted...
code -1
class base;
task print();
........
endtask
endclass
class derived extends base;
task print();
........
endtask
endclass
module main();
base b; //Instance
derived d; //Instance
initial
begin
b=new();
d=b;
d.print();
end
endmodule
code-2
class base;
task print();
........
endtask
endclass
class derived extends base;
task print();
........
endtask
endclass
module main();
base b; //Instance
derived d; //Instance
initial
begin
b=new();
d=new();
d.print();
end
endmodule
plz explain the meaning of declaration in this manner
Regards
Sunil.
code -1
class base;
task print();
........
endtask
endclass
class derived extends base;
task print();
........
endtask
endclass
module main();
base b; //Instance
derived d; //Instance
initial
begin
b=new();
d=b;
d.print();
end
endmodule
code-2
class base;
task print();
........
endtask
endclass
class derived extends base;
task print();
........
endtask
endclass
module main();
base b; //Instance
derived d; //Instance
initial
begin
b=new();
d=new();
d.print();
end
endmodule
plz explain the meaning of declaration in this manner
Regards
Sunil.
Last edited: