Here one of four fundamental concept of OOP come in role it is Encapsulation.
Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the scop of it
Encapsulation can be described as a protective barrier that prevents the code and data being randomly accessed by other code defined outside the class.
In case of your code you said, argument can be public,like b but why not c. It is because scope the c is only for method demo() and it will accessible only within it. Same is applicable for final.