So starting in Java 9, we can use var to declare local variables:
var s = "cool";
is there a way to use a similar construct when declaring fields?
class Container {
final var s = "cool"; // does not compile tmk
}
doesn't seem like it from what I can tell.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…