Java 8 Stack Allocation

Jump to navigation Jump to search

Meanwhile, builder functions behaves the same as constructors. e.g.

Point2D.Double origin() {
  return new Point2D.Double(0, 0);
}

void stack() {
  Point2D.Double a = origin();
  a.setLocation(1, 1);
}

behaves the same as previous example.

Xor (talk)04:32, 24 February 2018