I have a SampleClass with static field a and b and a static method init. To re-create SampleClass with new value for a and b, I use below syntax:
public class SampleClass{
private static int b;
private static int a;
public static void init(int a, int b) {
SampleClass.a = a; //line 7
SampleClass.b = b; //line 8
}
}
I actually feel awkward about line 7 and line 8. Is this acceptable or there are more correct ways to do this?