如何檢查ArrayList的對象是否與另一個對象匹配,無論元素的順序及其出現次數如何。讓我們說我有:檢查兩個ArrayList對象是否匹配
obj1 contains "boy", "girl", "kid"
obj2 contains "girl", "kid", "boy", "girl"
obj3 contains "woman", "boy", "girl", "kid"
所有的ArrayList的
我想要的程序來實現這一點:
obj1 = obj2 true
obj1 = obj3 false
obj2 = obj3 false
你已經嘗試到現在什麼? – Zeeshan
聽起來更像是一個'Set'而不是'List'。 – FatalError
參考 - http://stackoverflow.com/questions/16386278/how-to-check-if-objects-in-an-array-list-has-the-same-value – Suhas