[Java] Easy Solution || Using for loop || ArrayList
\nclass MedianFinder {\n    \n    ArrayList<Integer> list;\n\n    public MedianFinder() {\n        list = new ArrayList<>();\n    }\n    \n    public void addNu
```\nclass MedianFinder {\n    \n    ArrayList<Integer> list;\n\n    public MedianFinder() {\n        list = new ArrayList<>();\n    }\n    \n    public void addNum(int num) {\n        int i;\n        if(list.size() > 0){\n            for (i = 0; (i < list.size()  && list.get(i) < num); i++);\n            list.add(i , num);\n        }else{\n            list.add(num);\n        }\n    }\n    \n    public double findMedian() {\n        // System.out.println(list);\n        int index = list.size()/2;\n        if(list.size() % 2 == 0){\n            return (double) (list.get(index) + list.get(index - 1))/2;\n        }else{\n            return list.get(index);\n        }\n        \n    }\n}\n```\n\n**Upvote Please**
['Array', 'Java']