but when i created some other MainVariables classes at other places instead of them reaching to the same window two window is being created.
yes i know maybe there are better methods but currently i m working on polymorphism and i need some static members. so i need to resolve it to fix my problem.
"but when i created some other MainVariables classes at other places"
This statement seems to imply that your are creating other classes with static variables of the same name. Static variables are only shared across the class your accessing, and defining static variables with similar names in other locations will point to another variable.