simple conditional in java (unexpected issue)
问题 I have an unexpected issue when using a conditional operator in java. The code is supposed to check if the ArrayList contains a specific string, then it returns true or false. It is not the first time I do this, but for some reason there's something wrong. This is my code so far: public boolean isDone() { ArrayList<String> al = new ArrayList<String>(); //Defining ArrayList al.add(d1.getText()); // Adding the text from JLabels. al.add(d2.getText()); al.add(d3.getText()); al.add(d4.getText());