What does it mean for an array to hold "double"s?

As is seen in the “Java Arrays” exercise, what are doubles? I cannot find any reference prior to this exercise


Now, we’re going to store the averages on the most recent math test. Create an array called mathScores and set it to an empty array of size 4. It should hold double s.

Hey! Welcome to the forums! :wave:

A double is a data type used to store floating point numbers (i.e numbers with a decimal place). It’s very similar to a float. The only difference is with the amount of precision that can be stored, a float is represented in 32 bits, while a double is represented in twice that (hence the name), this means that a lot more decimal places can be stored and a much higher accuracy can be achieved using a double, with the downside of it taking up more space.

There is part of the “Variables” exercise on the Java course here that covers them.

Happy coding! :slight_smile:

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.