• + 0 comments

    //This is my solution, use in case to need

    public static void main(String[] args) {
        List<Object> result = Arrays.asList(1, 2, 3, "Hello","World");
        for (Object object : result) {
            if(object instanceof String){
                System.out.println(object.toString());
            }else{
                Integer temp =(Integer) object;
                System.out.println(temp);
            } 
        }
    }