Answer the question
In order to leave comments, you need to log in
How to correctly implement the method?
I recently started learning Java.
You need to implement the setName method so that it can be used to set
the value of the private String name variable equal to the passed String name parameter.
public class MainClass {
private String name;
public void setName(String name) {
/* только сюда можно писать код */
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question