Comment

Comment by ashishb

Class Rect { final int x, y;

  //Constructor goes here
}

Rect r1 = new Rect(1,2);

Is this not sufficient to create an immutable rectangle that I can pass around safely in a multi-threaded code?

parent ashishb 1 year ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton