You are not recording a list of names; your nameOfficial field only records the last name entered. And you have not given any way for the other class to find that name. Also your counter variable is never used anywhere. You can simplify that class like this without losing any functionalityNote that I haven't added anything; I have only moved two lines about Scanner and deleted a lot of unnecessary code.
Please draw a diagram with squares showing your classes (like a UML class diagram), and show where you are recording names.
Thanks by response!
I can know of you, because you put the class Register how construct ?
And now resolved the problem, how add the names of class FunctionInitial ?
Add on method addOficial, and list ?
I am a beginner.
Please, me help.
Joined: Oct 13, 2005
Don't know. Please draw a diagram of what you want, with the fields and the methods.That sort of thing. But that is only a start. I am sure you ought not to use a String for namesOfficial, but something else. Maybe a List<String> (=ArrayList<String>)
subject: Questions of how access methods of other class.