What is necessity of pre_randomize() and post_randomize() method in System verilog?

In reply to pkoti0583:

Hello ,
You can introduce user-defined functions inside these pre and post_randomize . some times all variable needed not be randomized and these variable may depend on previous cycle transaction variables like data inversions , ecc checks etc or you may want to change the randomized values.(pre randomize will be useful in inherited classes)