0

I have list = [1,0,1], but each number in the List are of type String. I do

if ( String.join("",list) == "101"){ 
    return true
}

As you can see, these to Strings are equal but it won't return true.

nicobld
  • 131
  • 2
  • 12

1 Answers1

1

try this: using equals

if ( String.join("",list).equals("101")){ 
    return true
}
MikeCAT
  • 73,922
  • 11
  • 45
  • 70
Seek Addo
  • 1,871
  • 2
  • 18
  • 30