Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

Question

If I have a data member initialized as:

Code Block
java
java
protected double[] _refPoint = new double[3];

does this zero fill _refPoint or does it contain uninitialized memory?

Answer

Java classes are never allowed to have unreferenced memory. Arrays are always zero filled. (Thus code should always run reproducibly – unless you use random numbers or rely on some external data source).