n*******g 发帖数: 168 | 1 final JLabel label = new JLabel("nonothing")
这里的一个类实例被声明为final代表什么呢?
多谢! | g*****g 发帖数: 34805 | 2 Only means you can't assign label to another instance.
if you later on do
label = new JLabel("something"), it will yield compilation error.
You can do label.setxxx() and change its fields however.
【在 n*******g 的大作中提到】 : final JLabel label = new JLabel("nonothing") : 这里的一个类实例被声明为final代表什么呢? : 多谢!
| n*******g 发帖数: 168 | 3 thanks :)
【在 g*****g 的大作中提到】 : Only means you can't assign label to another instance. : if you later on do : label = new JLabel("something"), it will yield compilation error. : You can do label.setxxx() and change its fields however.
|
|