object reference

Hi,

I got "[100, 200] []" for the following program. Can anyone explain me why s2 is not printing [100,200]?

public static void main(String[] args)

{

Stack s1 = new Stack ();

Stack s2 = new Stack ();

S1 e1 = new S1 ();

e1.convert (s1,s2);

System.out.println (s1 + " "+ s2);

}

public void convert(Stack s1, Stack s2)

{

s1.push (new Integer ("100"));

s2= s1;

s2.push(new Integer("200")) ;

}

[486 byte] By [Tamil_CSEa] at [2007-11-27 5:45:07]
# 1
Well, you're printing two stacks, so you're going to have two lots of square brackets. But I don't think that's what you really wanted to ask, is it?
dannyyatesa at 2007-7-12 15:26:33 > top of Java-index,Core,Core APIs...