Question: Java: Write a method called longest Name that accepts a Scanner for the console and an integer n as parameters and prompts for n names,
Write a method called longest Name that accepts a Scanner for the console and an integer n as parameters and prompts for n names, then prints the longest name (the name that contains the most characters) in the format shown below, which might result from a call of longest Name (console,4): name hash 1? ROY name hash 2? DANE name hash 3? sTeFaNiE name hash 4? Mariana Stefanie's name is longest
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
