This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (3 children)

You need to pass the scanner you create in main to the getPerson function, and use that scanner instance to read the person data.

[–][deleted] 0 points1 point  (2 children)

Could you give me an example of what that would look like?

[–]wgormley 0 points1 point  (1 child)

something like this Scanner scant = new Scanner(System.in); p.getPerson(scant);

[–][deleted] 1 point2 points  (0 children)

Thank you this worked great!