I have a class called Scouting, and it runs a function in a different class ScoutingFormData(different java file in the same package). I want it so that an integer defined in Scouting can be edited from ScoutingFormData. I defined the int:public int SFID=-1; in the main class of Scouting, but I can’t figure out how to edit that int from ScoutingFormData.
I have a class called Scouting, and it runs a function in a different
Share
Don’t make your instance fields public, use getter and setters.
This is if your field needs to be an instance field.
If you need a field that belongs to the class
ScoutingObjectyou need to make it staticThen you can access it like this: