Hello! Can you help me correct this code? I keep seeing these errors when I execute my program. (java:937, java:1478, java:11).
import java.util.Scanner; public class FindName { public static void main(String[] args) { String findName; int flag = 0, i = 0; try (Scanner scanner = new Scanner(System.in)) { System.out.println("Check the name: "); findName = scanner.next(); } String[] names = {"Zach", "Seb","Jacob","Carlo","Harry", "Henry", "Nico", "Enrico", "Evan" ,"Chris"}; for(i = 0; i < names.length; i++) { if(names[i] == findName) { flag = 1; System.out.println("We found"+(i + 1)); break; } else { flag = 0; System.out.println("Not here"); } } if(flag == 1) { System.out.println("We found"+(i + 1)); } else { System.out.println("Not here"); } } }