Linear Array Search
I'm trying to perform a linear array search in the main method of this code.
publicclass Final{
publicstaticvoid main (String[] args){
int key = 0;
String [][][] = sNames ={
{{"John","Joe P","Jane"},{"Amber","Amy","Bethany"},{"Joe F","Logan","Reno"},{"Amy P","Nico","Tony"}},
{{"Misty","Bartley","Kristy"},{"Mike","Bill D","Michelle"},{"Peggy","Jared","Katy D"},{"Amy D","Kelly","Emily"}},
{{"Jerry","Sarah","Eileen"},{"Carolyn","Dorsie","Corma"},{"Larry","Andrea","Anne"},{"Carrie","Cheryl","Chris"}},
{{"Colleen","Connie","Dave"},{"Shelly","Debbie","Doug"},{"Emma","Evan","Geoff"},{"Goutham","Jenny","Jimmie"}},
{{"Kevin","Kim L","Laura"},{"Mark","Maureen","Mike W"},{"Rachel","Ralph","Randy"},{"Sandipto","Sarah P","Saren"}}
};
for(int i = 0; i < sNames.length; i++){
if (key.equals (sNames[i]))
return i;
}
return -1;
}
}
The user should search for a name in the list and if the name is returned then give the index otherwise give -1.
I keep getting these errors:
Not a statement on line String [][][] = sNames ={
and
';' expected on the line String [][][] = sNames ={

