What is non denotable type? José Paumard breaks it down.
11,467 次观看
What is non denotable type? José Paumard breaks it down.
1 条评论
评论来自 X (Twitter) 上的原帖

@kreout
@JosePaumard var x = new Object() { int n = 1; }; System.out.println(x.n); This works because var retains the anonymous class's type. Change only var to Object and x.n no longer compiles. A small example where replacing var changes which members are accessible.
