The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Array default initilization

Posted by Suchak Jani on January 23, 2001 at 9:11 AM

> Arrays in java are implmented same as any other object. So, the same rule applies .....

Kishori Ji

could you throw somelight as to what would happen in these two cases
1)---
Array a = { new XYZ("sss"),new XYZ("sss1"),new XYZ("sss2"));

Now is it enough that i say that after i no longer
need the array

a = null;

If it is then what happens to the abjects of type XYZ in the heap?

2)---

Array a = { 1 ,2 ,3};

Also Now is it enough that i say that after i no longer need the array

a = null

Thank you so much
Regards
Suchak Jani



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us