I have some doubts about usage of static method in Java. I read many places static variables are instance independent so be comes global.
public class ThirdC
You have two different mains, meaning it will have 2 different execution paths. You either start with one or with the other, the value of the changed static variable is only changed for the current execution, on a different execution it always reset to the default value.
Try not to have a second main but rather a static method and then call it on the first main after the change, you will see a different result then.