0

I added a string into an arraylist, but when i want to retrieve it, it does not go into if conditional in the code below:

ArrayList a=new ArrayList();
        a.add("12");
        System.out.println(Integer.toString(1)+","+Integer.toString(2));
        if((Integer.toString(1)+Integer.toString(2))==a.get(0)){
            System.out.println("this is working here");
        }

What is the problem here?

2
Contributors
2
Replies
15
Views
4 Years
Discussion Span
Last Post by abra_ka_dabra
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.