Question: how to correctly take in a array and string parameter that looks for a city and prints out all the information using toString which has
how to correctly take in a array and string parameter that looks for a city and prints out all the information using toString which has all the information
public static void lookUp(City [] cit, String n ){
for(int i = 0; i < cit.length; i++){
if(cit[i].name.equals(n)){
System.out.println(cit[i].name);
System.out.println(cit.toString());
}
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
