Thanks Grish and parsad
consider this
1
String x=new String("mystring");
2 amethod(x);
line1 creats a string object and x is a referance to that object
line2 calls amethod and a copy of x is sent to the method as parameter
now consider this
acomponent.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {}});
I have a little doubt here .
When a action(of ActionEvent type) is
performed what does ActionListener receives?
As I understood from your explaination it should receive
a referance to that action event object(like x which refers to
a String object on line1)
Then actionPerformed is called with a copy of that referance
(just like line2)
Am i right?