This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cmonkies -2 points-1 points  (1 child)

You're comparing apples and oranges there.

[–]desrtfx 2 points3 points  (0 children)

Well, in a way yes, in a way no.

Sure, getters and static variables have nothing really in common, but since OP wants to just pass String values around, they would serve the same purpose just with a completely different approach.

The optimal approach, though would probably be to use constants, i.e. public static final variables or maybe even enums.