I need help with my code. Nothing is being printed out. I know the lists work because blocked out the ifs and tried both one at a time. What im trying to do is get the if statment to work if i type in Group1 to run the first list and group2 to run the second if. Or instead of the ifs, can someone tell me how i run an argument to run the first list and a second argument to run the second list? Im still kind of confused about what an argument is. One of my friends said its like in the cmd when you type ipconfig /renew and "/renew" is argument. Im using eclipse to make my program.
Thanks
import java.util.ArrayList; import java.io.*; public class Sorting { public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub String userInput; String command1= "Group1"; BufferedReader dataIn = new BufferedReader(new InputStreamReader(System.in)); userInput = dataIn.readLine(); String menu = userInput; //List 1 if ( menu == command1) { List input1 = new List("groupA"); List input2 = new List("groupB"); ArrayList<String> myList = input1.getList(); ArrayList<String> myList2 = input2.getList(); myList.removeAll(myList2); System.out.println("myList =" + myList); System.out.println(myList.size()); } //List 2 if ( menu == "Group2") { List input1 = new List("groupC.txt"); List input2 = new List("groupD.txt"); ArrayList<String> myList = input1.getList(); ArrayList<String> myList2 = input2.getList(); myList.removeAll(myList2); System.out.println("myList =" + myList); System.out.println(myList.size()); } } }