Yep, its a size issue.
Without static, you have an instance variable in every instance that all point to the same string (done by the compiler so that string literals that are equivalent are also indentical). So you pay for 1 object reference per instance of the enclosing class.
If you make it static, you have one object reference, period. So you might save 4 bytes per instance by using static and since its a constant (it *is* a constant, right?) its a more rational way to do things.
The only speed impact would be at object construction time, the cost of initializing the per instance reference to the string. This is likely negligible - I doubt you could measure it without creating 100k objects in a tight loop and measuring the difference.
The average hunter gatherer works 20 hours a week.
The average farmer works 40 hours a week.
The average programmer works 60 hours a week.
What the hell are we thinking?
Yep, its a size issue.
Without static, you have an instance variable in every instance that all point to the same string (done by the compiler so that string literals that are equivalent are also indentical). So you pay for 1 object reference per instance of the enclosing class.
If you make it static, you have one object reference, period. So you might save 4 bytes per instance by using static and since its a constant (it *is* a constant, right?) its a more rational way to do things.
The only speed impact would be at object construction time, the cost of initializing the per instance reference to the string. This is likely negligible - I doubt you could measure it without creating 100k objects in a tight loop and measuring the difference.
The average hunter gatherer works 20 hours a week.
The average farmer works 40 hours a week.
The average programmer works 60 hours a week.
What the hell are we thinking?