So I know how to reference variables from different classes, but I'm wondering if it's worth me creating a Vars.class to house all my global vars.
This would make it easier for me if I need to change them at a later date however, I'm wondering if this is a bad idea speed wise? Does it take longer to reference a var from a different class?
Thanks
EDIT: When i say 'global variables', I meant 'global constants'. Apologies for the confusion. I want them to be referable from other classes, but they will not be changed on the fly.
Vars.java
package test;
public class Vars
{
static int variable1 = 16;
static int variable2 = 32;
}
Start.java
package test;
public class Start
{
public Start()
{
int i = Vars.variable1;
}
}