473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Redeclare an array;what happens to its objects?

hi,

i want to know what happens to objects in an array if i redeclare the
array..
look at the following code:

////my code

public MyClass[] myarray=new MyClass[ somevalue ];

for( int counter = 0 ; counter < somevalue ; counter++ )
myarray[counter]=new MyClass();

///somewhere elese
myarray=new MyClass[ some_new_value ]
////end of code
in this case what will happen to my old intances of MyClass?did they
destroy when i redeclare myarray with some_new_value?

thanks in advance.
behzad

Apr 8 '06 #1
1 3229
"Behzad" <Se*********@gmail.com> a écrit dans le message de news:
11*********************@g10g2000cwb.googlegroups.c om...

| i want to know what happens to objects in an array if i redeclare the
| array..

If there are no other references to the contained objects, then they will be
GCed.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Apr 8 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: M.Siler | last post by:
<HTML> <HEAD> <TITLE></TITLE> <SCRIPT> <!-- var factor_val = new Array(8,7) factor_val = 68.8 factor_val = 55
6
by: Kutty Banerjee | last post by:
Hi, MyClass *myclass_=new MyClass; and MyClass::MyClass(int) and no default constructor. My object assignment obviously gives an error. So waht is the correct way to do it without using vectors...
2
by: Raphael Iloh | last post by:
Hi all, I'm having problems comparing array objects. Take a look at this: int array1 = new int{1}; int array2 = new int{1}; Console.Writeln(array1.Equals(array2)); One would expect the above...
3
by: Frank | last post by:
C#: cubearray?? int cubeArray = {{{7, 2}, {1, 4}}, {{3, 5}, {4, 4}}}; How do I interpret the above array statement? regards, Frank
1
by: Leszek | last post by:
Hi. I'm using <pre><?php print_r($_POST); ?> </pre> and i'm getting this: Array (
7
by: kulpojke | last post by:
I am trying to map a function to the contents of an array using the map() function. However, whenever the following function is called an error message is returned complaining that: ... line...
4
Ispep
by: Ispep | last post by:
Hi, unfortunately having a bit of difficulty with a question from an Open University course I'm currently doing. If you could help me out in any way I'd be grafeul (though obviously it goes without...
13
by: milk242 | last post by:
I know I'm making a mistake, but I'm wondering if someone could tell me the type of mistake I'm making. I know I can write the whole array to a file, but I want to create separate binary files for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.