posted 23 years ago
Hi,
I came with a very basic question about swing component. Could
anybody clear it out?
Sometimes i find class instance in both way.
label = new JLabel("Click.", JLabel.CENTER); // 1st statem
Jlabel label = new JLabel("Click.", JLabel.CENTER); // 2nd statem
In the 2nd statement, i am instantiating and intialising
Jlabel constructor as label and a copy of reference to
the Jlabel Object, isn't it?.
My question is that why sometimes we use the 1st statement to
give a same effect instead of second. In the 1st statement
there is no Jlabel Object?
Do appreciate if you clarify that.
Thanks,
Golam Newaz