JAVA Confused by ArrayList Initialization : I am confused by the line "**res.add(new ArrayList<Integer>(temp))**;" in function dfs, could you please tell me why it's wrong if I just use **res.add(temp)**? Thank you guys.

    public List<List<Integer>> subsets(int[] nums) {
        List<List<Integer>> res=new ArrayList<>();
        if(nums.length==0||nums==null)
            return res;
        Arrays.sort(nums);
        List<Integer> temp=new ArrayList<>();
        dfs(nums,0,res,temp); 
        return res;
    }
    public void dfs(int[] nums, int index, List<List<Integer>> res, List<Integer> temp) {
        res.add(new ArrayList<Integer>(temp));
        for(int i=index;i<nums.length;i++) {
            temp.add(nums[i]);
            dfs(nums,i+1,res,temp);
            temp.remove(temp.size()-1);
        }
    }