How to create a “Setter” in Java [duplicate]
问题 This question already has answers here : Set and Get Methods in java? (15 answers) Closed 4 years ago . I am unsure how to create a setter method in java. Everything that I found on the internet either shows how to "generate" one in eclipse or doesn't include what I am looking for. I am looking for a simple answer in plain terms, if that is possible. I understand what a setter-method does, but am unsure about the syntax and specific code. Thank you for your time. 回答1: A setter is a method