A static method can access a non-stationary object, but only if it is passed to the method. Given that the static method in question is the method in which the program starts, you have no way to pass anything to it.
What he cannot do within the non-static class is access to any of the instance members or functions. The problem is not that you create ha from a static method, but that you are accessing member members, which is a member of an instance that belongs to every instance of your class.
To fix this, you can either pass the points to the JustPractice (ha) instance that you create and return one of the JustPractice methods the final value, or you can make the points end () and happy (), in which case everyone can work happily together.
source share