Change Scene and Transfar a variable to it

how can i use variables i used to use in ex scene at new scene?
im using java and making variables like this

var ABC:String=“”;

and i can not use the variables at another scene tho,
is there any way to do that?
sorry for my bad english
thank you

When you load up a scene all current Objects will be destroyed and all new scene objects will be instantiated. To stop an old object from being destroyed use DontDestroyOnLoad. This way the script, and all it’s variables, will transfer to the next scene.