You never enter any data into temperatures
.
Therefore temperatures.size() == 0
Anything divided by 0 is NaN
So the code is doing exactly what you told it to.
More Related Contents:
- NumberFormatException not wrking java
- Getting Arraylist IndexOutOfBoundsException
- How to move elements of Java ArrayList to file in java [closed]
- Create ArrayList from array
- Initialization of an ArrayList in one line
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- Why do I get an UnsupportedOperationException when trying to remove an element from a List?
- How to randomize two ArrayLists in the same fashion?
- ConcurrentModificationException when adding inside a foreach loop in ArrayList [duplicate]
- What are the differences between ArrayList and Vector?
- How to make a deep copy of Java ArrayList [duplicate]
- How much data can a List can hold at the maximum?
- How do I find out what type each object is in a ArrayList?
- From Arraylist to Array
- Trouble with Gson serializing an ArrayList of POJO’s
- Finding duplicate values in arraylist
- Empty an ArrayList or just create a new one and let the old one be garbage collected? [duplicate]
- Simple way to compare 2 ArrayLists
- ArrayList.remove is not working in a loop
- Hash Set and Array List performances
- Scanner skipping every second line from file [duplicate]
- Check if an ArrayList contains every element from another ArrayList
- Adding to an ArrayList Java
- Can not deserialize instance of java.util.ArrayList out of VALUE_STRING
- Merging two arrayLists into a new arrayList, with no duplicates and in order, in Java
- Time Complexity for Java ArrayList
- how to fix java.lang.IndexOutOfBoundsException
- How to declare an ArrayList with values? [duplicate]
- How to remove common values from two array lists
- Why does the ArrayList implementation use Object[]?