ref and out are the output parameters that returns the output of the method to the program.
the difference between ref and out is:
when ref is used, the variables we are substituting while calling a method must be initialized but optional in case of out.