Randomize a variable

How to randomize a variable that is not declared as rand or randc?
Please explain with an example.

In reply to Nitin C J:

If you want to randmozie variable between 1-10 if you rand it will pick any one which cannot predicate where in randc it will pick sequentially like 1,2,3,…

In reply to Nitin C J:

See section 18.12 in the 1800-2017 LRM for an explanation and example.

In reply to Nitin C J:
class a
bit x;
rand bit y;
endclass:a

a a_obj; //object of class a

a_obj.randomize(x); //in this case x becomes rand variable and y becomes state variable