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.

Daemond-Creep
  • 111
  • 1
  • 12

1 Answers1

1

try this: using equals

if ( String.join("",list).equals("101")){ 
    return true
}
MikeCAT
  • 69,090
  • 10
  • 44
  • 65
Seek Addo
  • 1,823
  • 2
  • 17
  • 30