2

I am tring to go through a hashmap and extract each ArrayList inside it and match the sexith index with the value "thelessonyouneed"

String thelessonyouneed = "Math";
for (int che = 0 ;  che < dataofqusations.size(); che++) {
    ArrayList<String> datatobe = (ArrayList<String>) dataofqusations.get(String.valueOf(che));
    if (thelessonyouneed == datatobe.get(6)) {
        System.out.println(che);
    } else {
        System.out.println("No match");
    }
};

the out put gives me wrong info

I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: No match
I/System.out: Match

The correct info should be all indexes except 2. What is the thing I am missing here !?

C. L.
  • 571
  • 1
  • 8
  • 26
Mousa Alribi
  • 300
  • 3
  • 11

0 Answers0