0
        Scanner in = new Scanner(System.in);
        
        
        String ox = in.next();
                
        String[] oxline = ox.split("");
        


        for (int i = 0; i < oxline.length; i++) {
            
        if (**oxline[i] == "O"**) {
            System.out.println("it work");
        } else {
            
        }

        }

I can't compare the index element with the char.

How can you compare the letter "O" with the O in the index of the array?

0 Answers0