How can I search an object created array in Java? -
i've made array of class artist user able enter details of artist console , saves array want able search artist allowing user enter artist name in console , if matches name of in array print out found or else not found!
use loop run through array, , in loop use if/else statement, if word entered matches array holds in spot display it, else nothing.
for(int = 0; < array.length; i++){ if(thingentered.equals(array[i])){ print out } }
Comments
Post a Comment